<template>
  <div class="app-container">
    <el-collapse v-model="activeName" @change="handleChange">
      <el-collapse-item>
        <template slot="title">
          <span style="font-size:20px; margin-left:20px;letter-spacing:2px;color:red">
            <i class="el-icon-warning"></i>
            <span> 当前节点：{{ currentNode == null ? '???' : currentNode.nodeName ? currentNode.nodeName : '结束' }}</span>
            <!-- <span v-if = "currentNode.tasks.length>0" style="margin-left:30px">任务：</span>  -->
            <!-- <span v-for="( t,index) in currentNode.tasks" :key=index  >{{t.info}}</span> -->
            <!-- <span style="margin-left:30px" v-if="statementNo || reportNo">该流程已取：<el-tag type="success" v-if="statementNo">{{statementNo}}</el-tag> <el-tag type="danger" v-if="reportNo">{{reportNo}}</el-tag></span> -->
          </span>
          <span style="font-size:15px; margin-left:15px;letter-spacing:2px; color:RGB(168,168,168)">
            点击展开查看实时流程图
          </span>
        </template>
        <WorkflowBoard ref='board' @workflowCommitVerify="workflowCommitVerify" :nodeBusinessInfo="nodeBusinessInfo"
          @getPreviousNode="getPreviousNode" />
      </el-collapse-item>
    </el-collapse>
    <div class="button-area" v-if="couldEdit">
      <el-button @click="openProductionDialog"
        v-if="currentNode.nodeCode === 'PRODUCT_CHOICE' || currentNode.nodeCode === 'REPORT_CHOICE'" type="danger" round>
        选择产品
      </el-button>
      <el-button @click="openAssetsAchievementRatioDialog()" v-if="currentNode.nodeCode === 'CHECK_ARCHIVING'"
        type="danger" round>
        <!-- <span v-if="currentNode.nodeCode === 'RECHECK_ARCHIVING'">复审部</span> -->
        归档审核
      </el-button>
      <el-button v-if="nodeBusinessInfo.currentNodePermission.commit" class="y-save" type="success" round
        @click="commit('PASS')" :disabled="!nodeBusinessInfo.doWorkflow">提交</el-button>
      <el-button v-if="nodeBusinessInfo.currentNodePermission.reversible" class="y-save" type="warning" round
        @click="commit('REVERSE')" :disabled="!nodeBusinessInfo.doWorkflow">退回</el-button>
      <el-button v-if="nodeBusinessInfo.currentNodePermission.skippable" class="y-save" type="warning" round
        @click="commit('SKIP')" :disabled="!nodeBusinessInfo.doWorkflow">跳过</el-button>
      <el-button v-if="nodeBusinessInfo.currentNodePermission.terminable" class="y-save" type="danger" round
        @click="commit('TERMINATE')" :disabled="!nodeBusinessInfo.doWorkflow">终止</el-button>
      <el-button v-if="nodeBusinessInfo.currentNodePermission.restartable" class="y-save" type="danger" round
        @click="commit('RESTART')" :disabled="!nodeBusinessInfo.doWorkflow">重置</el-button>
      <el-button class="y-save" round type="info" @click="goBack">返回</el-button>
    </div>
    <el-tabs v-model="activeTabName" @tab-click="handleClick" type="border-card">
      <el-tab-pane name="baseInfo" class="pane-class" :lazy=true>
        <span slot="label"><i class="el-icon-document"></i>基本信息</span>
        <y-detail-page-layout ref="addAssetsOrder" name="assets">
          <el-form ref="assetsForm" :model="assetsForm" :rules="assetsFormRules" :disabled="disabledStatus">
            <div class="createMajor-main-container">
              <div class="postInfo-container">
                <el-row class="row-style" style="margin-top: 20px; float: right; position: relative; z-index: 2;">
                  <el-col :xs="24" :sm="12" :lg="23" :span="12">
                    <el-button type="danger" @click="updateOrderBaseInfo()" round>更新基本信息</el-button>
                  </el-col>
                </el-row>
                <div>
                  <el-divider content-position="left">
                    <h3 class="title">
                      <div class="avatar-wrapper icon-title">订单</div>
                      <div class="icon-info">资产订单</div>
                    </h3>
                  </el-divider>
                </div>
                <el-row class="row-style">
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="客户经理：" prop="clientManager" label-width="120px" class="postInfo-container-item">
                      <el-input :value="assetsForm.clientManagerName" class="filter-item" readonly disabled
                        style=" width: 225px" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="4" :span="6">
                    <el-form-item label="接单部门：" prop="departmentId" label-width="120px" class="postInfo-container-item">
                      <el-select v-model="assetsForm.departmentId" readonly disabled>
                        <el-option v-for="(d, id) in allotDepartment" :label="d.name" :value="d.id"
                          :key="d.id"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row class="row-style">
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item prop="name" label-width="120px" class="postInfo-container-item" label="项目名称：">
                      <el-input v-model="assetsForm.name" class="filter-item" />
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row class="row-style">
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="业务类型：" prop="assetsBusinessGener" label-width="120px"
                      class="postInfo-container-item">
                      <el-select v-model="assetsForm.assetsBusinessGener" filterable placeholder="业务类型">
                        <el-option v-for="(s, index) in assetsBusinessGeners" :label="s.label" :value="s.value"
                          :key="s.id"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="客户再次委托：" prop="entrustAgain" label-width="140px" class="postInfo-container-item">
                      <el-radio v-model="assetsForm.entrustAgain" :label="false" border size="medium">否</el-radio>
                      <el-radio v-model="assetsForm.entrustAgain" :label="true" border size="medium">是</el-radio>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row class="row-style">
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="客户类型：" prop="clienteleType" label-width="120px" class="postInfo-container-item">
                      <el-select v-model="assetsForm.clienteleType" placeholder="请选择"
                        @change="changeCustomerType(assetsForm.clienteleType)" readonly disabled>
                        <el-option label="企业" value="企业"></el-option>
                        <el-option label="个人" value="个人"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="客户名称：" prop="clienteleId" label-width="120px" class="postInfo-container-item"
                      v-if="itemHideStatus">
                      <el-select v-model="assetsForm.clienteleId" placeholder="请选择(可搜索)" @change="findSubClientele(0)"
                        clearable filterable readonly disabled>
                        <el-option v-for="(c, id) in customerCompany" :label="c.name" :value="c.id"
                          :key="c.id"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="业务来源：" prop="clienteleSubId" label-width="120px" class="postInfo-container-item"
                      v-if="itemHideStatus">
                      <el-select v-model="assetsForm.clienteleSubId" placeholder="请选择(可搜索)" @change="getCustomerContract"
                        clearable filterable readonly disabled>
                        <el-option v-for="(s, id) in subCustomerCompany" :label="s.name" :value="s.id"
                          :key="s.id"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row class="row-style">
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="客户联系人：" prop="clienteleContactId" label-width="120px"
                      class="postInfo-container-item">
                      <div>
                        <el-select v-model="assetsForm.clienteleContactId" placeholder="请选择(可搜索)" clearable filterable
                          @change="getContactInfo();" style="width:60%" readonly disabled>
                          <!-- <el-option v-for="(c, id) in customerContract" :label="c.name" :value="c.id"
                            :key="c.id"></el-option> -->
                          <el-option :label="linkmanInfo.name" :value="linkmanInfo.id" :key="linkmanInfo.id"></el-option>
                        </el-select>
                        <!-- <el-tooltip class="item" effect="dark" content="没有联系人？点击新增" placement="top-end">
                          <span style="margin-left:5%;color:RGB(64,158,255);cursor:pointer"
                            @click="createLinkman(false)">新增</span>
                        </el-tooltip> -->
                      </div>
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="联系人电话：" prop="mobile" label-width="120px" class="postInfo-container-item">
                      <el-input :value="assetsForm.linkmanMobile" class="filter-item" readonly disabled
                        style=" width: 225px" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="联系人部门：" prop="department" label-width="120px" class="postInfo-container-item">
                      <el-input :value="assetsForm.linkmanDepartment" class="filter-item" readonly disabled
                        style=" width: 225px" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="联系人职务：" prop="duty" label-width="120px" class="postInfo-container-item">
                      <el-input :value="assetsForm.linkmanDuty" class="filter-item" readonly disabled
                        style=" width: 225px" />
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row class="row-style">
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="是否证券项目：" prop="security" label-width="140px" class="postInfo-container-item">
                      <el-radio v-model="assetsForm.security" :label="false" border size="medium">否</el-radio>
                      <el-radio v-model="assetsForm.security" :label="true" border size="medium">是</el-radio>
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="是否资产重组项目：" prop="significantAssetsReorganization" label-width="200px"
                      class="postInfo-container-item">
                      <el-radio v-model="assetsForm.significantAssetsReorganization" :label="false" border
                        size="medium">否</el-radio>
                      <el-radio v-model="assetsForm.significantAssetsReorganization" :label="true" border
                        size="medium">是</el-radio>
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label=" 是否国资项目：" prop="stateAssets" label-width="140px" class="postInfo-container-item">
                      <el-radio v-model="assetsForm.stateAssets" :label="false" border size="medium">否</el-radio>
                      <el-radio v-model="assetsForm.stateAssets" :label="true" border size="medium">是</el-radio>
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="是否涉及境外资产：" prop="foreignAssetsInvolved" label-width="200px"
                      class="postInfo-container-item">
                      <el-radio v-model="assetsForm.foreignAssetsInvolved" :label="false" border
                        size="medium">否</el-radio>
                      <el-radio v-model="assetsForm.foreignAssetsInvolved" :label="true" border size="medium">是</el-radio>
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="是否分配产值：" prop="dispenseBenefit" label-width="140px"
                      class="postInfo-container-item">
                      <el-radio v-model="assetsForm.dispenseBenefit" :label="false" border size="medium">否</el-radio>
                      <el-radio v-model="assetsForm.dispenseBenefit" :label="true" border size="medium">是</el-radio>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row class="row-style">
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="委托人：" prop="bailor" label-width="120px" class="postInfo-container-item">
                      <el-input v-model="assetsForm.bailor" class="filter-item" style=" width: 225px" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="委托联系人：" prop="bailorContactName" label-width="120px"
                      class="postInfo-container-item">
                      <el-input v-model="assetsForm.bailorContactName" class="filter-item" style=" width: 225px" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="委托人联系人电话：" prop="bailorContactTel" label-width="160px"
                      class="postInfo-container-item">
                      <el-input v-model="assetsForm.bailorContactTel" class="filter-item" style=" width: 225px" />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="委托人地址：" prop="bailorAddress" label-width="120px" class="postInfo-container-item">
                      <el-input v-model="assetsForm.bailorAddress" class="filter-item" style=" width: 225px" />
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row class="row-style">
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="终端客户类型：" prop="terminalClienteleType" label-width="140px"
                      class="postInfo-container-item">
                      <el-select v-model="assetsForm.terminalClienteleType" placeholder="请选择" style="width:205px" readonly
                        disabled>
                        <el-option label="企业" value="企业"></el-option>
                        <el-option label="个人" value="个人"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6" v-if="assetsForm.terminalClienteleType === '企业'">
                    <el-form-item label="终端客户名称：" prop="terminalClienteleId" label-width="140px"
                      class="postInfo-container-item">
                      <!-- <div v-if="couldEdit"> -->
                      <el-select v-model="assetsForm.terminalClienteleId" placeholder="请选择(可搜索)"
                        @change="findSubClientele(1)" clearable filterable style="width:80%" readonly disabled>
                        <!-- <el-option v-for="(c, id) in tCustomerCompany" :label="c.name" :value="c.id"
                            :key="c.id"></el-option> -->
                        <el-option :label="tCustomerInfo.name" :value="tCustomerInfo.id"
                          :key="tCustomerInfo.id"></el-option>
                      </el-select>
                      <!-- <el-tooltip class="item" effect="dark" content="没有终端客户？点击新增" placement="top-end">
                          <span style="margin-left:5%;color:RGB(64,158,255);cursor:pointer"
                            @click="createTerminalClient()">新增</span>
                        </el-tooltip> -->
                      <!-- </div> -->
                      <!-- <el-input :value="assetsForm.tterminalClienteleName" class="filter-item" style=" width: 225px"
                        v-else /> -->
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6" v-if="assetsForm.terminalClienteleType === '个人'">
                    <el-form-item label="终端联系人：" prop="terminalClienteleContactId" label-width="120px"
                      class="postInfo-container-item">
                      <div v-if="couldEdit">
                        <el-select v-model="assetsForm.terminalClienteleContactId" placeholder="请选择(可搜索)" clearable
                          filterable @change="" style="width:80%" readonly disabled>
                          <!-- <el-option v-for="(c, id) in tCustomerContract" :label="c.name" :value="c.id"
                            :key="c.id"></el-option> -->
                          <el-option :label="tLinkmanInfo.name" :value="tLinkmanInfo.id"
                            :key="tLinkmanInfo.id"></el-option>
                        </el-select>
                        <!-- <el-tooltip class="item" effect="dark" content="没有联系人？点击新增" placement="top-end">
                          <span style="margin-left:5%;color:RGB(64,158,255);cursor:pointer"
                            @click="createTlinkman()">新增</span>
                        </el-tooltip> -->
                      </div>
                      <el-input :value="assetsForm.tterminalClienteleContactName" class="filter-item"
                        style=" width: 225px" v-else />
                    </el-form-item>
                  </el-col>
                  <el-col :xs="24" :sm="12" :lg="6" :span="6">
                    <el-form-item label="终端联系电话：" prop="clienteleType" label-width="150px"
                      class="postInfo-container-item">
                      <el-input :value="assetsForm.tmobile" class="filter-item" readonly disabled style=" width: 215px" />
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row class="row-style">
                  <el-col :xs="24" :sm="12" :lg="23" :span="12">
                    <el-form-item label="备注：" prop="remark" label-width="120px" class="postInfo-container-item">
                      <el-input v-model="assetsForm.remark" :autosize="{ minRows: 4, maxRows: 4 }" class="filter-item"
                        type="textarea" />
                    </el-form-item>
                  </el-col>
                </el-row>
              </div>
            </div>
          </el-form>
        </y-detail-page-layout>
      </el-tab-pane>
      <el-tab-pane name="members" class="pane-class" :lazy=true>
        <span slot="label"><i class="el-icon-document"></i>项目人员</span>
        <!-- <y-detail-page-layout @save="updatePrincipalAndMembers" ref="addAssetsOrder" name="assets"
          :editStatus="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION' || !disabledStatus"> -->
        <el-form ref="assetsForm" :model="assetsForm" :rules="assetsFormRules"
          :disabled="currentNode.nodeCode !== 'DEPARTMENT_ALLOCATION' || disabledStatus">
          <div class="createMajor-main-container">
            <div class="postInfo-container">
              <div style="margin-top: 35px;">
                <el-divider content-position="left">
                  <h3 class="title">
                    <div class="avatar-wrapper icon-title">成员</div>
                    <div class="icon-info">项目成员</div>
                  </h3>
                </el-divider>
              </div>
              <el-row class="row-style">
                <el-col :xs="24" :sm="12" :lg="4" :span="6">
                  <el-form-item label="接单部门：" prop="departmentId" label-width="120px"
                    :class="['postInfo-container-item', currentNode.nodeCode === 'DEPARTMENT_ALLOCATION' ? 'task-class' : '']">
                    <el-select @change="getPrincipalByAllotDepartment()" v-model="assetsForm.departmentId">
                      <el-option v-for="(d, id) in allotDepartment" :label="d.name" :value="d.id" :key="d.id"></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row class="row-style">
                <el-col :xs="24" :sm="12" :lg="6" :span="6">
                  <el-form-item label="项目负责人：" prop="principalId" label-width="120px"
                    :class="['postInfo-container-item', currentNode.nodeCode === 'DEPARTMENT_ALLOCATION' ? 'task-class' : '']"
                    :rules="{ required: true, message: '项目负责人不能为空', trigger: 'blur' }">
                    <el-select v-model="assetsForm.principalId" placeholder="请选择(可搜索)"
                      :filterable="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION'"
                      :clearable="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION'"
                      :readonly="currentNode.nodeCode != 'DEPARTMENT_ALLOCATION'"
                      :disabled="currentNode.nodeCode != 'DEPARTMENT_ALLOCATION'">
                      <el-option v-for="(p, id) in principals" :label="p.name" :value="p.id" :key="p.id"></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row class="row-style">
                <el-col :xs="24" :sm="12" :lg="3" :span="6">
                  <el-form-item label="项目成员：" prop="members" label-width="120px"
                    :class="['postInfo-container-item', currentNode.nodeCode === 'DEPARTMENT_ALLOCATION' ? 'task-class' : '']"
                    :rules="{ required: true, message: '项目成员不能为空', trigger: 'blur' }">
                    <el-select v-model="assetsForm.members" placeholder="请选择(可搜索)" multiple style=" width: 686px"
                      :filterable="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION'"
                      :clearable="currentNode.nodeCode === 'DEPARTMENT_ALLOCATION'"
                      :readonly="currentNode.nodeCode != 'DEPARTMENT_ALLOCATION'"
                      :disabled="currentNode.nodeCode != 'DEPARTMENT_ALLOCATION'">
                      <el-option v-for="(u, id) in allUsers" :label="u.name" :value="u.id" :key="u.id"></el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row class="row-style">
                <el-col :xs="24" :sm="12" :lg="3" :span="6">
                  <el-button type="danger" @click="updatePrincipalAndMembers()" round>保存项目人员信息</el-button>
                </el-col>
              </el-row>
            </div>
          </div>
        </el-form>
        <!-- </y-detail-page-layout> -->
      </el-tab-pane>
      <el-tab-pane name="target" class="pane-class" :lazy=true>
        <span @click="getAETargetListByAssetsId()" slot="label"><i class="el-icon-document"></i>资产评估对象</span>
        <div class="createMajor-main-container">
          <div class="postInfo-container">
            <div style="margin-top: 35px;">
              <el-divider content-position="left">
                <h3 class="title">
                  <div class="avatar-wrapper icon-title">评估</div>
                  <div class="icon-info">资产评估对象</div>
                </h3>
              </el-divider>
            </div>
            <el-row>
              <el-col :span="2">
                <div>
                  <el-statistic group-separator="," :precision="4" :value="totalEvaluateValue" title="估价对象总价(万)">
                    <template slot="prefix">
                      <i class="el-icon-coin"></i>
                    </template>
                  </el-statistic>
                </div>
              </el-col>
              <el-col :span="2">
                <el-button v-if="currentNode.nodeCode === 'SPOT_RECONNAISSANCE_DETERMINE_PRICE' && couldEdit"
                  type="danger" @click="openTargetDialog(), changeStatus('add')" round>添加评估对象</el-button>
              </el-col>
              <el-col :span="2" v-if="currentNode.nodeCode === 'GENERATE_STATEMENT' && couldEdit">
                <el-tooltip class="item" effect="dark" content="全选取主号，多次取号(主号-子号)" placement="right">
                  <el-button type="success" @click="takeAssetsStatementProductionNo('STATEMENT')" round>意见书取号</el-button>
                </el-tooltip>
              </el-col>
              <el-col :span="2" v-if="currentNode.nodeCode === 'ASSET_REPORT_TAKE_NO' && couldEdit">
                <el-tooltip class="item" effect="dark" content="全选取主号，多次取号(主号-子号)" placement="right">
                  <el-button type="success" @click="takeAssetsReportProductionNo('REPORT')" round>报告取号</el-button>
                </el-tooltip>
              </el-col>
              <el-col :span="2" v-if="(currentNode.nodeCode === 'GENERATE_STATEMENT' && writeProductionStatementNos.length > 0)
                || (currentNode.nodeCode === 'WRITE_REPORT' && writeProductionReportNos.length > 0)
                && couldEdit">
                <el-tooltip class="item" effect="dark" content="请仔细确认产品内容" placement="right">
                  <el-button type="success" @click="openWriteProductionDialog(false, 'add')" round>撰写产品信息</el-button>
                </el-tooltip>
              </el-col>
            </el-row>
            <el-table ref="multipleTable" :data="assetsEvaluationTarget" stripe @selection-change="targetSelectionChange"
              :header-row-style="{ color: '#333333' }" border takeNumberItems style="width: 100%; margin-top:20px">
              <el-table-column type="selection" width="55" :selectable="selectable">
              </el-table-column>
              <el-table-column prop="id" label="id" width="80" align="center">
              </el-table-column>
              <el-table-column width="220" prop="statementNo" label="意见书号" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column width="220" prop="reportNo" label="报告号" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="statementCreateProductionDate" label="意见书出具状态" align="center" show-overflow-tooltip>
                <template slot-scope="{row}">
                  <el-tag v-if="row.statementCreateProductionDate !== null" type='success'> 已出具</el-tag>
                  <el-tag v-if="row.statementCreateProductionDate == null" type='danger'> 未出具</el-tag>
                </template>
              </el-table-column>
              <el-table-column prop="reportCreateProductionDate" label="报告出具状态" align="center" show-overflow-tooltip>
                <template slot-scope="{row}">
                  <el-tag v-if="row.reportCreateProductionDate !== null" type='success'> 已出具</el-tag>
                  <el-tag v-if="row.reportCreateProductionDate == null" type='danger'> 未出具</el-tag>
                </template>
              </el-table-column>
              <el-table-column prop="purposeName" label="评估目的" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column label="评估对象" align="center" show-overflow-tooltip>
                <template slot-scope="{row}">
                  <span>{{ row.targetTypename }}</span>
                  <span>--</span>
                  <span>{{ row.secTargetTypaName }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="theHolder" label="产权持有人" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="valueTypeName" label="价值类型" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="totalAssetCarryingAmount" label="总资产账面值（万）" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="totalLiabilitiesCarryingAmount" label="总负债账面值（万）" align="center"
                show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="carryingAmountOfNetAssets" label="净资产账面值（万）" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="estimatedValue" label="评估价格（万）" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="checkValue" label="审核价格（万）" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column label="操作" align="center" width="130" fixed="right">
                <template slot-scope="scope">
                  <el-button type="text" size="small"
                    @click="getAssetsTargetDetail(scope.row.id), changeStatus('detail')">
                    查看
                  </el-button>
                  <el-button v-if="currentNode.nodeCode === 'SPOT_RECONNAISSANCE_DETERMINE_PRICE'" type="text"
                    size="small" @click="getAssetsTargetDetail(scope.row.id), changeStatus('edit')">
                    编辑
                  </el-button>
                  <el-button v-if="currentNode.nodeCode === 'SPOT_RECONNAISSANCE_DETERMINE_PRICE'" type="text"
                    size="small" @click="assetsTargetDelete(scope.row.id)">删除</el-button>
                  <el-button v-if="currentNode.nodeCode === 'REVIEW_STATEMENT' || currentNode.nodeCode === 'CHECK_REPORT'"
                    type="text" size="small" @click="openCheckValueDialog(scope.row.id);">审核定价</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane name="production" class="pane-class" :lazy=true>
        <span slot="label" @click="getProductionList()"><i class="el-icon-document"></i>产品信息</span>
        <div class="createMajor-main-container">
          <div class="postInfo-container">
            <div style="margin-top: 35px;">
              <el-divider content-position="left">
                <h3 class="title">
                  <div class="avatar-wrapper icon-title">产品</div>
                  <div class="icon-info">资产产品信息</div>
                </h3>
              </el-divider>
            </div>
            <div style="margin-top: 30px; color: red;" v-if="currentNode.nodeCode === 'GENERATE_STATEMENT' && couldEdit">
              选择要提交的意见书：
              <el-select v-model="commitProductionNo" @change="pushProductionNo()" placeholder="请选择要提交的产品"
                style="width: 300px;">
                <el-option v-for="(pro, productionNo) in assetsProductionData" v-if="pro.productionType == 'STATEMENT'"
                  :label="pro.productionNo" :value="pro.productionNo" :key="pro.id"></el-option>
              </el-select>
            </div>
            <div style="margin-top: 30px; color: red;" v-if="currentNode.nodeCode === 'WRITE_REPORT' && couldEdit">
              选择要提交的报告：
              <el-select v-model="commitProductionNo" @change="pushProductionNo()" placeholder="请选择要提交的产品"
                style="width: 300px;">
                <el-option v-for="(pro, productionNo) in assetsProductionData" v-if="pro.productionType !== 'STATEMENT'"
                  :label="pro.productionNo" :value="pro.productionNo" :key="pro.id"></el-option>
              </el-select>
            </div>
            <div style="margin-top: 30px;">
              <span v-if="currentNode.nodeCode === 'STATEMENT_BOOKBINDING_STAMP'">
                <span v-for="pro in assetsProductionData" :key="pro.id" style="color: red;">
                  打印份数：{{ pro.printCount }}
                </span>
              </span>
            </div>
            <!-- <el-table ref="multipleTable" :data="assetsProductionData" stripe :header-row-style="{ color: '#333333' }"
              border takeNumberItems style="width: 100%; margin-top:20px">
              <el-table-column prop="id" label="id" width="80" align="center">
              </el-table-column>
              <el-table-column width="200" prop="productionNo" label="产品号" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="productionType" label="产品类型" align="center" show-overflow-tooltip>
                <template slot-scope="{row}">
                  <span v-if="row.productionType === 'STATEMENT'">价值意见书</span>
                  <span v-if="row.productionType == 'LETTER'">意见函</span>
                  <span v-if="row.productionType == 'CONSULT'">咨询报告</span>
                  <span v-if="row.productionType == 'REPORT'">评估报告</span>
                </template>
              </el-table-column>
              <el-table-column prop="clientName" label="委托方名称" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="clientTel" label="委托方电话" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="valuationBasisDate" label="评估基准日" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="evaluateAcreage" label="评估面积" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="evaluatePrice" label="评估单价" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="evaluateAmount" label="评估总价" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="owner" label="产权人" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="printCount" label="产品打印数量" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="createProductionDate" label="产品出具日期" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="comment" label="特殊情况说明" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="repertoryState" label="库存状态" align="center" show-overflow-tooltip>
                <template slot-scope="{row}">
                  <span v-if="row.repertoryState === null">未入库</span>
                  <span v-if="row.repertoryState === true">已出库</span>
                  <span v-if="row.repertoryState === false">已入库</span>
                </template>
              </el-table-column>
              <el-table-column prop="repertoryInTime" label="入库时间" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="repertoryOutTime" label="出库时间" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="saveFileDate" label="归档日期" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column prop="delivery" label="送达状态" align="center" show-overflow-tooltip>
                <template slot-scope="{row}">
                  <span v-if="!row.delivery">未送达</span>
                  <span v-if="row.delivery">已送达</span>
                </template>
              </el-table-column>
              <el-table-column label="操作" align="center" width="180" fixed="right">
                <template slot-scope="scope">
                  <el-button type="text" size="small"
                    @click="openWriteProductionDialog(true, 'detail'), getAssetsProductionDetail(scope.row.id)">
                    查看
                  </el-button>
                  <el-button v-if="currentNode.nodeCode === 'REVIEW_STATEMENT'" type="text" size="small"
                    @click="openWriteProductionDialog(false, 'edit'), getAssetsProductionDetail(scope.row.id)">
                    编辑
                  </el-button>
                  <el-button
                    v-if="currentNode.nodeCode === 'REVIEW_STATEMENT' && scope.row.productionType === 'STATEMENT'"
                    type="text" size="small"
                    @click="productionPerformanceForm.productionId = scope.row.id, openProductionCheckDialog()">
                    审核意见书
                  </el-button>
                  <el-button
                    v-if="currentNode.nodeCode === 'REEXAMINE_STATEMENT' && scope.row.productionType === 'STATEMENT'"
                    type="text" size="small"
                    @click="productionPerformanceForm.productionId = scope.row.id, openProductionCheckDialog()">
                    复审意见书
                  </el-button>
                  <el-button v-if="currentNode.nodeCode === 'CHECK_REPORT' && scope.row.productionType !== 'STATEMENT'"
                    type="text" size="small"
                    @click="productionPerformanceForm.productionId = scope.row.id, openProductionCheckDialog()">
                    审核报告
                  </el-button>
                  <el-button v-if="currentNode.nodeCode === 'RECHECK_REPORT' && scope.row.productionType !== 'STATEMENT'"
                    type="text" size="small"
                    @click="productionPerformanceForm.productionId = scope.row.id, openProductionCheckDialog()">
                    复审报告
                  </el-button>
                  <el-button
                    v-if="currentNode.nodeCode === 'FOURTH_CHECK_REPORT' && scope.row.productionType !== 'STATEMENT'"
                    type="text" size="small"
                    @click="productionPerformanceForm.productionId = scope.row.id, openProductionCheckDialog()">
                    四审报告
                  </el-button>
                  <el-button
                    v-if="(currentNode.nodeCode === 'STATEMENT_IN' || currentNode.nodeCode === 'REPORT_IN') && scope.row.repertoryState === null"
                    type="text" size="small" @click="openWareHouseDialog(scope.row);">产品入库</el-button>
                  <el-button
                    v-if="(currentNode.nodeCode === 'STATEMENT_OUT' || currentNode.nodeCode === 'REPORT_OUT') && scope.row.repertoryState === false"
                    type="text" size="small" @click="openWareHouseDialog(scope.row);">产品出库</el-button>
                </template>
              </el-table-column>
            </el-table> -->
            <el-table :data="assetsProductionData" stripe :header-row-style="{ color: '#333333' }" border takeNumberItems
              style="width: 100%; margin-top:20px">
              <el-table-column type="expand">
                <template slot-scope="props">
                  <el-form label-position="left">
                    <el-tag style="margin-left: 20px;" effect="plain" size="medium" disable-transitions><span
                        style="font-size:16px">基本信息</span></el-tag>
                    <el-row class="row-style">
                      <el-col :xs="24" :sm="6" :lg="3" :span="3" class="postInfo-container-item">
                        <el-form-item label-width="150px" label="委托方名称：">
                          <span>{{ props.row.clientName }}</span>
                        </el-form-item>
                      </el-col>
                      <el-col :xs="24" :sm="6" :lg="3" :span="3" class="postInfo-container-item">
                        <el-form-item label-width="150px" label="委托方电话：">
                          <span>{{ props.row.clientTel }}</span>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row class="row-style">
                      <el-col :xs="24" :sm="6" :lg="3" :span="3" class="postInfo-container-item">
                        <el-form-item label-width="150px" label="评估基准日：">
                          <span>{{ props.row.valuationBasisDate }}</span>
                        </el-form-item>
                      </el-col>
                      <el-col :xs="24" :sm="6" :lg="3" :span="3" class="postInfo-container-item">
                        <el-form-item label-width="150px" label="评估面积：">
                          <span>{{ props.row.evaluateAcreage }} m²</span>
                        </el-form-item>
                      </el-col>
                      <el-col :xs="24" :sm="6" :lg="3" :span="3" class="postInfo-container-item">
                        <el-form-item label-width="150px" label="评估单价：">
                          <span>{{ props.row.evaluatePrice }}（元）</span>
                        </el-form-item>
                      </el-col>
                      <el-col :xs="24" :sm="6" :lg="3" :span="3" class="postInfo-container-item">
                        <el-form-item label-width="150px" label="评估总价：">
                          <span>{{ props.row.evaluateAmount }}（万）</span>
                        </el-form-item>
                      </el-col>
                      <el-col :xs="24" :sm="6" :lg="3" :span="3" class="postInfo-container-item">
                        <el-form-item label-width="150px" label="产权人：">
                          <span>{{ props.row.owner }}</span>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row class="row-style">
                      <el-col :xs="24" :sm="6" :lg="3" :span="3" class="postInfo-container-item">
                        <el-form-item label-width="150px" label="产品打印数量：">
                          <span>{{ props.row.printCount }}（份）</span>
                        </el-form-item>
                      </el-col>
                      <el-col :xs="24" :sm="6" :lg="3" :span="3" class="postInfo-container-item">
                        <el-form-item label-width="150px" label="产品出具日期：">
                          <span>{{ props.row.createProductionDate }}</span>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row class="row-style">
                      <el-col :xs="24" :sm="6" :lg="3" :span="3" class="postInfo-container-item">
                        <el-form-item label-width="150px" label="资料附件：">
                          <el-link type="primary" v-for="file in props.row.filePath" :key="file.name" :href="file.url">
                            {{ file.name }}
                          </el-link>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row class="row-style">
                      <el-col :xs="24" :sm="6" :lg="3" :span="3" class="postInfo-container-item">
                        <el-form-item prop="qrCode" label-width="150px" label="产品二维码：">
                          <img style="width:130px;height:120px; display:inline-block ;" :src="props.row.qrCode"
                            alt="NULL" />
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-row class="row-style">
                      <el-col :xs="24" :sm="12" :lg="6" :span="6" class="postInfo-container-item">
                        <el-form-item label-width="150px" label="特殊情况说明：">
                          <span>{{ props.row.comment }}</span>
                        </el-form-item>
                      </el-col>
                    </el-row>
                    <el-tag style="margin-left: 20px;" effect="plain" size="medium" disable-transitions><span
                        style="font-size:16px">库存状态</span></el-tag>
                    <el-steps :active="props.row.repertoryState == null ? 0 : (props.row.repertoryState ? 2 : 1)"
                      process-status="success" finish-status="success" simple style="margin: 10px 1% 20px 40px">
                      <el-step title="未入库"></el-step>
                      <el-step title="已入库"></el-step>
                      <el-step title="已出库"></el-step>
                    </el-steps>
                  </el-form>
                </template>
              </el-table-column>
              <el-table-column prop="id" label="id" width="120" align="center">
              </el-table-column>
              <el-table-column prop="productionNo" label="产品号" align="center" show-overflow-tooltip>
                <template slot-scope="{row}">
                  <el-tag type="success"><span>{{ row.productionNo }}</span></el-tag>
                </template>
              </el-table-column>
              <el-table-column prop="productionType" label="产品类型" align="center" show-overflow-tooltip>
                <template slot-scope="{row}">
                  <el-tag v-if="row.productionType === 'STATEMENT'">价值意见书</el-tag>
                  <el-tag v-if="row.productionType == 'LETTER'">意见函</el-tag>
                  <el-tag v-if="row.productionType == 'CONSULT'">咨询报告</el-tag>
                  <el-tag v-if="row.productionType == 'REPORT'">评估报告</el-tag>
                </template>
              </el-table-column>
              <el-table-column prop="repertoryState" label="库存状态" align="center" show-overflow-tooltip>
                <template slot-scope="{row}">
                  <el-tag type="danger" v-if="row.repertoryState === null">未入库</el-tag>
                  <el-tag type="success" v-if="row.repertoryState === true">已出库</el-tag>
                  <el-tag type="warning" v-if="row.repertoryState === false">已入库</el-tag>
                </template>
              </el-table-column>
              <el-table-column prop="comment" label="特殊情况说明" align="center" show-overflow-tooltip>
              </el-table-column>
              <el-table-column label="操作" align="center" width="180" fixed="right">
                <template slot-scope="scope">
                  <el-button type="text" size="small"
                    @click="openWriteProductionDialog(true, 'detail'), getAssetsProductionDetail(scope.row.id)">
                    查看
                  </el-button>
                  <el-button v-if="currentNode.nodeCode === 'REVIEW_STATEMENT'" type="text" size="small"
                    @click="openWriteProductionDialog(false, 'edit'), getAssetsProductionDetail(scope.row.id)">
                    编辑
                  </el-button>
                  <el-button
                    v-if="currentNode.nodeCode === 'REVIEW_STATEMENT' && scope.row.productionType === 'STATEMENT'"
                    type="text" size="small"
                    @click="productionPerformanceForm.productionId = scope.row.id, openProductionCheckDialog()">
                    审核意见书
                  </el-button>
                  <el-button
                    v-if="currentNode.nodeCode === 'REEXAMINE_STATEMENT' && scope.row.productionType === 'STATEMENT'"
                    type="text" size="small"
                    @click="productionPerformanceForm.productionId = scope.row.id, openProductionCheckDialog()">
                    复审意见书
                  </el-button>
                  <el-button v-if="currentNode.nodeCode === 'CHECK_REPORT' && scope.row.productionType !== 'STATEMENT'"
                    type="text" size="small"
                    @click="productionPerformanceForm.productionId = scope.row.id, openProductionCheckDialog()">
                    审核报告
                  </el-button>
                  <el-button v-if="currentNode.nodeCode === 'RECHECK_REPORT' && scope.row.productionType !== 'STATEMENT'"
                    type="text" size="small"
                    @click="productionPerformanceForm.productionId = scope.row.id, openProductionCheckDialog()">
                    复审报告
                  </el-button>
                  <el-button
                    v-if="currentNode.nodeCode === 'FOURTH_CHECK_REPORT' && scope.row.productionType !== 'STATEMENT'"
                    type="text" size="small"
                    @click="productionPerformanceForm.productionId = scope.row.id, openProductionCheckDialog()">
                    四审报告
                  </el-button>
                  <el-button
                    v-if="(currentNode.nodeCode === 'STATEMENT_IN' || currentNode.nodeCode === 'REPORT_IN') && scope.row.repertoryState === null"
                    type="text" size="small" @click="openWareHouseDialog(scope.row);">产品入库</el-button>
                  <el-button
                    v-if="(currentNode.nodeCode === 'STATEMENT_OUT' || currentNode.nodeCode === 'REPORT_OUT') && scope.row.repertoryState === false"
                    type="text" size="small" @click="openWareHouseDialog(scope.row);">产品出库</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
      </el-tab-pane>
      <el-tab-pane name="finance" class="pane-class" :lazy=true>
        <span slot="label" @click="getOrderFundInvoiceById()"><i class="el-icon-document"></i>款项信息</span>
        <div class="createMajor-main-container">
          <div class="postInfo-container">
            <div style="margin-top: 35px;">
              <el-divider content-position="left">
                <h3 class="title">
                  <div class="avatar-wrapper icon-title">款项</div>
                  <div class="icon-info">资产款项信息</div>
                </h3>
              </el-divider>
            </div>
          </div>
          <el-form ref="invoiceData" :model="invoiceData" :disabled="true">
            <el-row>
              <el-col :xs="24" :sm="12" :lg="6" :span="6">
                <el-form-item label="应收金额(元)：" prop="shouldAmount" label-width="120px" class="postInfo-container-item">
                  <el-input v-model="invoiceData.shouldAmount" class="filter-item" />
                </el-form-item>
              </el-col>
              <el-col :xs="24" :sm="12" :lg="6" :span="6">
                <el-form-item label="实收金额(元)：" prop="realAmount" label-width="120px" class="postInfo-container-item">
                  <el-input v-model="invoiceData.realAmount" class="filter-item" />
                </el-form-item>
              </el-col>
              <el-col :xs="24" :sm="12" :lg="6" :span="6">
                <el-form-item label="剩余金额(元)：" prop="leftAmount" label-width="120px" class="postInfo-container-item">
                  <el-input v-model="invoiceData.leftAmount" class="filter-item" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row v-for="(invoice, id) in invoiceData.financeInvoiceVoList" :key="id">
              <el-col :xs="24" :sm="12" :lg="6" :span="6">
                <el-form-item label="开票类型：" prop="type" label-width="120px" class="postInfo-container-item">
                  <el-input v-model="invoice.type" class="filter-item" />
                </el-form-item>
              </el-col>
              <el-col :xs="24" :sm="12" :lg="6" :span="6">
                <el-form-item label="发票抬头：" prop="title" label-width="120px" class="postInfo-container-item">
                  <el-input v-model="invoice.title" class="filter-item" />
                </el-form-item>
              </el-col>
              <el-col :xs="24" :sm="12" :lg="6" :span="6">
                <el-form-item label="税号：" prop="taxNo" label-width="120px" class="postInfo-container-item">
                  <el-input v-model="invoice.taxNo" class="filter-item" />
                </el-form-item>
              </el-col>
              <el-col :xs="24" :sm="12" :lg="6" :span="6">
                <el-form-item label="开户银行：" prop="bankName" label-width="120px" class="postInfo-container-item">
                  <el-input v-model="invoice.bankName" class="filter-item" />
                </el-form-item>
              </el-col>
              <el-col :xs="24" :sm="12" :lg="6" :span="6">
                <el-form-item label="银行地址：" prop="bankAddress" label-width="120px" class="postInfo-container-item">
                  <el-input v-model="invoice.bankAddress" class="filter-item" />
                </el-form-item>
              </el-col>
              <el-col :xs="24" :sm="12" :lg="6" :span="6">
                <el-form-item label="联系电话：" prop="bankTel" label-width="120px" class="postInfo-container-item">
                  <el-input v-model="invoice.bankTel" class="filter-item" />
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>

        </div>
      </el-tab-pane>
    </el-tabs>
    <el-dialog :visible.sync="targetDialogVisible" @open="clear()" @close="resettargetForm"
      custom-class="doWarehouseClass">
      <div>
        <el-form ref="targetForm" :model="targetForm" style="margin-top:20px" :rules="targetFormRules"
          :disabled="targetDisabledStatus">
          <el-divider content-position="left">【资产】评估对象</el-divider>
          <el-row class="row-style">
            <el-col :xs="24" :sm="12" :lg="12" :span="6">
              <el-form-item label="评估目的：" prop="evaluationPurposeId" label-width="120px" class="postInfo-container-item">
                <el-select v-model="targetForm.evaluationPurposeId">
                  <el-option v-for="(p, id) in assetsEvaluationTargetPurpose" :label="p.purposeName"
                    :value="p.id"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="row-style">
            <el-col :xs="24" :sm="12" :lg="12" :span="6" style="width: 350px;">
              <el-form-item label="评估对象：" prop="evaluationTypeId" label-width="120px" class="postInfo-container-item">
                <el-select v-model="targetForm.evaluationTypeId"
                  @change="getTypeList(targetForm.evaluationTypeId, 2), targetForm.evaluationTypeSecId = null">
                  <el-option v-for="(t, id) in assetsEvaluationTargetType" :label="t.typeName" :value="t.id"
                    :key="t.id"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :xs="4" :sm="12" :lg="12" :span="6">
              <el-form-item prop="evaluationTypeSecId" label-width="10px" class="postInfo-container-item">
                <el-select v-model="targetForm.evaluationTypeSecId">
                  <el-option v-for="(t, id) in assetsSecEvaluationTargetType" :label="t.typeName" :value="t.id"
                    :key="t.id"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="row-style">
            <el-col :xs="24" :sm="12" :lg="12" :span="6" style="width: 345px;">
              <el-form-item label="产权持有人：" prop="theHolder" label-width="120px" class="postInfo-container-item">
                <el-input v-model="targetForm.theHolder" class="filter-item" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="row-style">
            <el-col :xs="24" :sm="12" :lg="12" :span="6">
              <el-form-item label="价值类型：" prop="assetsValueId" label-width="120px" class="postInfo-container-item">
                <el-select v-model="targetForm.assetsValueId">
                  <el-option v-for="(t, id) in assetsValueType" :label="t.typeName" :value="t.id" :key="t.id"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="row-style">
            <el-col :xs="24" :sm="12" :lg="12" :span="6" style="width: 400px;">
              <el-form-item label="项目负责人：" label-width="120px" class="postInfo-container-item">
                <el-select v-model="targetForm.principalId" placeholder="请选择" readonly disabled>
                  <el-option v-for="(u, id) in allUsers" :label="u.name" :value="u.id" :key="u.id"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :lg="12" :span="6">
              <el-form-item label="实勘人：" prop="siteIds" label-width="120px" class="postInfo-container-item">
                <el-select v-model="targetForm.siteIds" placeholder="请选择" multiple>
                  <el-option v-for="(u, id) in allUsers" :label="u.name" :value="u.id" :key="u.id"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="row-style">
            <el-col :xs="24" :sm="12" :lg="7" :span="6">
              <el-form-item prop="valuationBasisDate" label-width="120px" label="估价基准日：" class="postInfo-container-item">
                <el-date-picker v-model="targetForm.valuationBasisDate" type="date" placeholder="选择日期" style="width:100%">
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="row-style">
            <el-col :xs="24" :sm="12" :lg="12" :span="6">
              <el-form-item label="评估方法：" prop="evaluationMethodId" label-width="120px" class="postInfo-container-item">
                <el-select v-model="targetForm.evaluationMethodId">
                  <el-option v-for="(m, id) in assetsEvaluationMethod" :label="m.methodName" :value="m.id"
                    :key="m.id"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="row-style">
            <el-col :xs="24" :sm="12" :lg="12" :span="6">
              <el-form-item label="最终选择的评估方法：" prop="choiceEvaluationMethodId" label-width="200px"
                class="postInfo-container-item">
                <el-select v-model="targetForm.choiceEvaluationMethodId">
                  <el-option v-for="(m, id) in assetsEvaluationMethod" :label="m.methodName" :value="m.id"
                    :key="m.id"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="row-style">
            <el-col :xs="24" :sm="12" :lg="12" :span="6">
              <el-form-item label="总资产账面值：" prop="totalAssetCarryingAmount" label-width="140px"
                class="postInfo-container-item">
                <el-input-number v-model="targetForm.totalAssetCarryingAmount" controls-position="right" :precision="2"
                  :step="0.1"></el-input-number>
                <span>（万）</span>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :lg="12" :span="6">
              <el-form-item label="总负债账面值：" prop="totalLiabilitiesCarryingAmount" label-width="140px"
                class="postInfo-container-item">
                <el-input-number v-model="targetForm.totalLiabilitiesCarryingAmount" controls-position="right"
                  :precision="2" :step="0.1"></el-input-number>
                <span>（万）</span>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :lg="12" :span="6">
              <el-form-item label="净资产账面值：" prop="carryingAmountOfNetAssets" label-width="140px"
                class="postInfo-container-item">
                <el-input-number v-model="targetForm.carryingAmountOfNetAssets" controls-position="right" :precision="2"
                  :step="0.1"></el-input-number>
                <span>（万）</span>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :lg="12" :span="6">
              <el-form-item label="评估结论对应的评估值：" prop="estimatedValue" label-width="200px" class="postInfo-container-item">
                <el-input-number v-model="targetForm.estimatedValue" controls-position="right" :precision="2"
                  :step="0.1"></el-input-number>
                <span>（万）</span>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="row-style" v-if="currentNode.nodeCode === 'REVIEW_QUOTATION'">
            <el-col :xs="24" :sm="12" :lg="12" :span="6">
              <el-form-item label="审核定价：" prop="checkValue" label-width="200px" class="postInfo-container-item">
                <el-input-number v-model="targetForm.checkValue" controls-position="right" :precision="2"
                  :step="0.1"></el-input-number>
                <span>（万）</span>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="row-style">
            <el-col :xs="24" :sm="12" :lg="18" :span="6">
              <el-form-item prop="filePath" label="资料附件：" label-width="120px" class="postInfo-container-item">
                <el-upload action="/api/upload" :limit="3" :on-success="changeresTarget" :on-exceed="handleExceed"
                  :on-preview="handleAttachmentPreview" :before-remove="beforeRemove" :file-list="fileList">
                  <el-button plain type="info" round style="width: 100%">上传附件<i
                      class="el-icon-upload el-icon--right"></i></el-button>
                </el-upload>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="row-style">
            <el-col :xs="24" :sm="12" :lg="23" :span="12">
              <el-form-item label="备注：" prop="remark" label-width="120px" class="postInfo-container-item">
                <el-input v-model="targetForm.remark" :autosize="{ minRows: 4, maxRows: 4 }" class="filter-item"
                  type="textarea" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="row-style">
            <el-button v-if="saveButtonStatus" @click="assetsTargetSave" style="width:100%;">保存</el-button>
            <el-button v-if="updateButtonStatus" @click="assetsTargetUpdate" style="width:100%;">更新</el-button>
          </el-row>
        </el-form>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="productionChoiceDialogVisible">
      <el-form ref="assetsProductionForm" :model="assetsProductionForm" :rules="assetsProductionFormRules">
        <div class="createMajor-main-container">
          <div class="postInfo-container">
            <div>
              <el-divider content-position="left">
                <h3 class="title">
                  <div class="avatar-wrapper icon-title">产品</div>
                  <div class="icon-info">选择产品</div>
                </h3>
              </el-divider>
            </div>
            <el-row class="row-style">
              <el-col :xs="24" :sm="12" :lg="12" :span="6" style="width: 800px;">
                <el-form-item label="产品类型：" prop="productionType" label-width="120px" class="postInfo-container-item">
                  <el-radio v-if="currentNode.nodeCode === 'PRODUCT_CHOICE'" v-model="assetsProductionForm.productionType"
                    label="STATEMENT" border size="medium">价值意见书</el-radio>
                  <el-radio v-model="assetsProductionForm.productionType" label="CONSULT" border
                    size="medium">咨询报告</el-radio>
                  <el-radio v-model="assetsProductionForm.productionType" label="REPORT" border
                    size="medium">评估报告</el-radio>
                  <el-radio v-model="assetsProductionForm.productionType" label="LETTER" border
                    size="medium">意见函</el-radio>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col :xs="24" :sm="12" :lg="12" :span="6" style="width: 345px;">
                <el-form-item label="打印份数：" prop="printCount" label-width="120px" class="postInfo-container-item">
                  <el-input v-model.number="assetsProductionForm.printCount" class="filter-item" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-button v-if="productionChoiceStatus == 0" @click="assetsProductionSave"
                style="width:100%;">提交</el-button>
              <el-button v-if="productionChoiceStatus == 1" @click="assetsProductionUpdateChoice"
                style="width:100%;">提交</el-button>
            </el-row>
          </div>
        </div>
      </el-form>
    </el-dialog>

    <el-dialog :visible.sync="productionWriteDialogVisible" @close="resetProductionForm">
      <el-form ref="assetsProductionForm" :model="assetsProductionForm" :rules="assetsProductionFormRules"
        :disabled="productionDisabledStatus">
        <div class="createMajor-main-container">
          <div class="postInfo-container">
            <div>
              <el-divider content-position="left">
                <h3 class="title">
                  <div class="avatar-wrapper icon-title">产品</div>
                  <div class="icon-info">撰写产品信息</div>
                </h3>
              </el-divider>
            </div>
            <el-row class="row-style">
              <el-col v-if="currentNode.nodeCode === 'GENERATE_STATEMENT'">
                <el-form-item label="产品号：" prop="productionNo" label-width="120px" class="postInfo-container-item">
                  <el-select v-model="assetsProductionForm.productionNo" @change="getAssetsProductionDetailByNo()"
                    placeholder="请选择" style="width: 300px;">
                    <el-option v-for="statementNo in writeProductionStatementNos" :label="statementNo"
                      :value="statementNo" :key="statementNo"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col v-if="currentNode.nodeCode === 'WRITE_REPORT'">
                <el-form-item label="产品号：" prop="productionNo" label-width="120px" class="postInfo-container-item">
                  <el-select v-model="assetsProductionForm.productionNo" @change="getAssetsProductionDetailByNo()"
                    placeholder="请选择" style="width: 300px;">
                    <el-option v-for="reportNo in writeProductionReportNos" :label="reportNo" :value="reportNo"
                      :key="reportNo"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col>
                <el-form-item label="项目名称：" prop="assetsName" label-width="120px" class="postInfo-container-item">
                  <el-input v-model.number="assetsProductionForm.assetsName" class="filter-item" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style" v-if="currentNode.nodeCode === 'WRITE_REPORT'">
              <el-col>
                <el-form-item label="签字人：" prop="signatory" label-width="120px" class="postInfo-container-item">
                  <el-select v-model="assetsProductionForm.signatory" placeholder="请选择" multiple>
                    <el-option v-for="(u, id) in allUsers" :label="u.name" :value="u.id" :key="u.id"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col>
                <el-form-item label="委托方名称：" prop="clientName" label-width="120px" class="postInfo-container-item">
                  <el-input v-model.number="assetsProductionForm.clientName" class="filter-item" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col>
                <el-form-item label="委托方电话：" prop="clientTel" label-width="120px" class="postInfo-container-item">
                  <el-input v-model.number="assetsProductionForm.clientTel" class="filter-item" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col>
                <el-form-item label="估价基准日：" prop="valuationBasisDate" label-width="120px"
                  class="postInfo-container-item">
                  <el-date-picker v-model="assetsProductionForm.valuationBasisDate" type="date" placeholder="选择日期"
                    style="width:100%">
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col>
                <el-form-item label="评估面积：" prop="evaluateAcreage" label-width="140px" class="postInfo-container-item">
                  <el-input-number v-model="assetsProductionForm.evaluateAcreage" @change="computeAmount"
                    controls-position="right" :precision="2" :step="0.1"></el-input-number>
                  <span>（m²）</span>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col>
                <el-form-item label="评估单价：" prop="evaluatePrice" label-width="140px" class="postInfo-container-item">
                  <el-input-number v-model="assetsProductionForm.evaluatePrice" @change="computeAmount"
                    controls-position="right" :precision="2" :step="0.1"></el-input-number>
                  <span>（元）</span>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col>
                <el-form-item label="评估总价：" prop="evaluateAmount" label-width="140px" class="postInfo-container-item">
                  <el-input-number v-model="assetsProductionForm.evaluateAmount" controls-position="right" :precision="2"
                    :step="0.1"></el-input-number>
                  <span>（万）</span>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col>
                <el-form-item label="资产持有人：" prop="owner" label-width="120px" class="postInfo-container-item">
                  <el-input v-model.number="assetsProductionForm.owner" class="filter-item" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col>
                <el-form-item label="产品打印份数：" prop="printCount" label-width="150px" class="postInfo-container-item">
                  <el-input v-model.number="assetsProductionForm.printCount" class="filter-item" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col>
                <el-form-item label="出具产品日期：" prop="createProductionDate" label-width="150px"
                  class="postInfo-container-item">
                  <el-date-picker v-model="assetsProductionForm.createProductionDate" type="date" placeholder="选择日期"
                    style="width:100%">
                  </el-date-picker>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col>
                <el-form-item prop="filePath" label="资料附件：" label-width="120px" class="postInfo-container-item">
                  <el-upload action="/api/upload" :limit="3" :on-success="changeresProduction" :on-exceed="handleExceed"
                    :on-preview="handleAttachmentPreview" :before-remove="beforeRemovePro" :file-list="fileList">
                    <el-button plain type="info" round style="width: 100%">上传附件<i
                        class="el-icon-upload el-icon--right"></i></el-button>
                  </el-upload>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col>
                <el-form-item label="特殊情况说明：" prop="comment" label-width="150px" class="postInfo-container-item">
                  <el-input v-model="assetsProductionForm.comment" :autosize="{ minRows: 4, maxRows: 4 }"
                    class="filter-item" type="textarea" />
                </el-form-item>
              </el-col>
            </el-row>

            <el-row class="row-style">
              <el-button v-if="writeType === 'add'" @click="writeAssetsProduction()" style="width:100%;">提交</el-button>
            </el-row>
            <el-row class="row-style">
              <el-button v-if="writeType === 'edit'" @click="productionUpdate()" style="width:100%;">提交</el-button>
            </el-row>
          </div>
        </div>
      </el-form>
    </el-dialog>
    <el-dialog :visible.sync="checkValueDialogVisible">
      <el-divider content-position="left">【资产】审核定价</el-divider>
      <el-form ref="targetForm" :model="targetForm" :rules="targetFormRules">
        <div class="createMajor-main-container">
          <div class="postInfo-container">
            <el-row>
              <el-col>
                <el-form-item label="评估方法：" prop="evaluationMethodId" label-width="120px" class="postInfo-container-item">
                  <el-select v-model="targetForm.evaluationMethodId">
                    <el-option v-for="(m, id) in assetsEvaluationMethod" :label="m.methodName" :value="m.id"
                      :key="m.id"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col>
                <el-form-item label="最终选择的评估方法：" prop="choiceEvaluationMethodId" label-width="200px"
                  class="postInfo-container-item">
                  <el-select v-model="targetForm.choiceEvaluationMethodId">
                    <el-option v-for="(m, id) in assetsEvaluationMethod" :label="m.methodName" :value="m.id"
                      :key="m.id"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col>
                <el-form-item label="审核价格：" prop="checkValue" label-width="140px" class="postInfo-container-item">
                  <el-input-number v-model="targetForm.checkValue" controls-position="right" :precision="2"
                    :step="0.1"></el-input-number>
                  <span>（万）</span>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col>
                <el-button @click="checkValue()" style="width:100%;">审核定价</el-button>
              </el-col>
            </el-row>
          </div>
        </div>
      </el-form>
    </el-dialog>
    <el-dialog :visible.sync="productionCheckDialogVisible" @close="resetProductionForm()">
      <el-form ref="productionPerformanceForm" :model="productionPerformanceForm">
        <div class="createMajor-main-container">
          <div class="postInfo-container">
            <div>
              <el-divider content-position="left">
                <h3 class="title">
                  <div class="avatar-wrapper icon-title">产品</div>
                  <div class="icon-info">产品质检</div>
                </h3>
              </el-divider>
            </div>
            <el-row class="row-style">
              <el-col>
                <el-form-item prop="normalMistake" label-width="120px" class="postInfo-container-item" label="一般错误个数:">
                  <el-input-number :min="0" style="width:50%;" type="number"
                    v-model="productionPerformanceForm.normalMistake" class="filter-item" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col>
                <el-form-item prop="normalMistake" label-width="120px" class="postInfo-container-item" label="较大错误个数:">
                  <el-input-number :min="0" style="width:50%;" type="number"
                    v-model="productionPerformanceForm.hardMistake" class="filter-item" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col>
                <el-form-item prop="fatalMistake" label-width="120px" class="postInfo-container-item" label="重大错误个数:">
                  <el-input-number :min="0" style="width:50%;" type="number"
                    v-model="productionPerformanceForm.fatalMistake" class="filter-item" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row class="row-style">
              <el-col :xs="24" :sm="12" :lg="24" :span="6">
                <el-form-item prop="reason" label-width="120px" class="postInfo-container-item" label="扣分原因:">
                  <el-input v-model.trim="productionPerformanceForm.reason" class="filter-item" type="textarea" />
                </el-form-item>
              </el-col>
            </el-row>
            <div v-if="currentNode.nodeCode === 'RECHECK_REPORT' || currentNode.nodeCode === 'FOURTH_CHECK_REPORT'">
              <el-row class="row-style">
                <el-col>
                  <el-form-item label="特殊情况说明：" prop="comment" label-width="150px" class="postInfo-container-item">
                    <el-input v-model="assetsProductionForm.comment" :autosize="{ minRows: 4, maxRows: 4 }"
                      class="filter-item" type="textarea" />
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row class="row-style">
                <el-col>
                  <el-form-item :rules="{ required: true, message: '请上传附件资料', trigger: 'changes' }" prop="filePath"
                    label="资料附件：" label-width="120px" class="postInfo-container-item">
                    <el-upload action="/api/upload" :limit="3" :on-success="changeresProduction" :on-exceed="handleExceed"
                      :on-preview="handleAttachmentPreview" :before-remove="beforeRemovePro" :file-list="fileList">
                      <el-button plain type="info" round style="width: 100%">上传附件<i
                          class="el-icon-upload el-icon--right"></i></el-button>
                    </el-upload>
                  </el-form-item>
                </el-col>
              </el-row>
            </div>
            <el-row>
              <el-col>
                <el-button style="width:100%;" @click="saveQuality()">提交</el-button>
              </el-col>
            </el-row>
          </div>
        </div>
      </el-form>
    </el-dialog>

    <el-dialog :visible.sync="warehouseDialog" width="25%" center top="35vh" custom-class="doWarehouseClass"
      @closed="cleanWareHouseProductionType()">
      <ScanEntry ref="scanEntry" @scanEntryFun="handleScanEntry" label="请扫描二维码或输入报告号" />
      <span slot="footer" class="dialog-footer">
        <el-button @click="warehouseDialog = false">取 消</el-button>
        <el-button type="primary" @click="doWareHouse()">确 定</el-button>
      </span>
    </el-dialog>

    <el-dialog :visible.sync="assetsAchievementRatioDialogVisible" @close="resetProductionForm()"
      @closed="resetBusinessPerformanceDistributionForm()" width="25%">
      <div v-if="businessPerformanceDistributionForm.distributionList !== null" class="createMajor-main-container">
        <div class="postInfo-container">
          <div>
            <el-divider content-position="left">
              <h3 class="title">
                <div class="avatar-wrapper icon-title">归档</div>
                <div class="icon-info">归档审核</div>
              </h3>
            </el-divider>
          </div>
          <!-- <p style="margin-top: 50px; color: red;">绩效比例：</p>
          <el-row style="margin-top: 10px;" v-for="(member, index) in assetsBusinessMembers" :key="index"
            class="row-style">
            <el-col>
              <p style="width: 65px; display: inline-block; text-align: right;">
                {{ member.memberName }}：
              </p>
              <el-input-number
                v-model="businessPerformanceDistributionForm.distributionList[index].performanceDistribution"
                :precision="2" :step="0.1" :max="100">
              </el-input-number>
              <p style="margin-left: 5px; display: inline-block;">
                %
              </p>
              <p style="margin-left: 5px; display: inline-block;">
                <span v-if="member.memberType === '项目负责人'" style="color: blueviolet;">
                  * {{ member.memberType }}
                </span>
                <span v-if="member.memberType === '项目参与人'">
                  * {{ member.memberType }}
                </span>
                <span v-if="member.memberType === '签字师'" style="color: red;">
                  * {{ member.memberType }}
                </span>
              </p>
            </el-col>
          </el-row> -->
          <span v-if="currentNode.nodeCode === 'CHECK_ARCHIVING'">
            <el-row style="margin-top: 10px;" class="row-style">
              <el-col>
                <el-form>
                  <el-form-item :rules="{ required: true, message: '请上传附件资料', trigger: 'changes' }" prop="filePath"
                    label="资料附件：" label-width="120px" class="postInfo-container-item">
                    <el-upload action="/api/upload" :limit="3" :on-success="changeresProduction" :on-exceed="handleExceed"
                      :on-preview="handleAttachmentPreview" :before-remove="beforeRemovePro" :file-list="fileList">
                      <el-button plain type="info" round style="width: 100%">上传附件<i
                          class="el-icon-upload el-icon--right"></i></el-button>
                    </el-upload>
                  </el-form-item>
                </el-form>
              </el-col>
            </el-row>
          </span>
        </div>
      </div>
      <span v-if="businessPerformanceDistributionForm.distributionList !== null" slot="footer" class="dialog-footer">
        <el-button @click="assetsAchievementRatioDialogVisible = false">取 消</el-button>
        <!-- <el-button v-if="showDistributionButton" type="primary" @click="saveBusinessPerformanceDistribution()">新
          增</el-button>
        <el-button v-if="!showDistributionButton" type="primary" @click="updateAssetsPerformanceDistribution()">修
          改</el-button> -->
        <el-button @click="updateProductionFileInfo(), assetsAchievementRatioDialogVisible = false">确 认</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import YDetailPageLayout from '@/components/YDetailPageLayout/index_detail'
import WorkflowBoard from '@/components/workflowBoard'
import ScanEntry from '@/components/ScanEntry'

export default {
  name: 'AssetsOrderDetail',
  components: {
    YDetailPageLayout,
    WorkflowBoard,
    ScanEntry
  },
  data() {
    var checkSignatoryLength = (rule, value, callback) => {
      if (this.assetsProductionForm.signatory !== undefined && this.assetsProductionForm.signatory !== null) {
        if (this.assetsProductionForm.signatory.length < 2) {
          return callback(new Error('需至少选择两个签字人'));
        } else {
          callback();
        }
      }
    };
    return {
      editStatus: false,
      // 资产业务表单禁用状态
      disabledStatus: true,
      // 评估对象表单禁用状态
      targetDisabledStatus: true,
      // 评估对象表单保存按钮显示状态
      saveButtonStatus: true,
      // 评估对象表单更新按钮显示状态
      updateButtonStatus: true,
      couldEdit: null,
      couldBack: null,
      // 表单项目隐藏字段
      itemHideStatus: false,
      createLinkmanVisible: false,
      // 文件上传数组
      fileList: [],
      // 资产业务下单表单校验规则
      assetsFormRules: {
        clientManager: [
          { required: true, message: '客户经理不能为空', trigger: 'blur' }
        ],
        departmentId: [
          { required: true, message: '请选择接单部门', trigger: 'change' }
        ],
        name: [
          { required: true, message: '项目名称不能为空', trigger: 'blur' }
        ],
        assetsBusinessGener: [
          { required: true, message: '请选择业务类型', trigger: 'change' }
        ],
        entrustAgain: [
          { required: true, message: '请选择客户是否再次委托', trigger: 'change' }
        ],
        clienteleType: [
          { required: true, message: '请选择客户类型', trigger: 'change' }
        ],
        clienteleId: [
          { required: true, message: '请选择客户名称', trigger: 'change' }
        ],
        clienteleSubId: [
          { required: true, message: '请选择业务来源', trigger: 'change' }
        ],
        clienteleContactId: [
          { required: true, message: '请选择客户联系人', trigger: 'change' }
        ],
        security: [
          { required: true, message: '请选择是否证券项目', trigger: 'change' }
        ],
        significantAssetsReorganization: [
          { required: true, message: '请选择是否资产重组项目', trigger: 'change' }
        ],
        stateAssets: [
          { required: true, message: '请选择是否是否国资项目', trigger: 'change' }
        ],
        foreignAssetsInvolved: [
          { required: true, message: '请选择是否 是否涉及境外资产', trigger: 'change' }
        ],
        dispenseBenefit: [
          { required: true, message: '请选择是否是否分配产值', trigger: 'change' }
        ],
        terminalClienteleType: [
          { required: true, message: '请选择终端客户类型', trigger: 'change' }
        ],
        terminalClienteleId: [
          { required: true, message: '终端客户名称不能为空', trigger: 'blur' }
        ],
        terminalClienteleContactId: [
          { required: true, message: '终端联系人不能为空', trigger: 'blur' }
        ]
      },
      workflowLogs: [],
      activeName: 'workflowInfo',
      activeTabName: "baseInfo",
      nodeBusinessInfo: {
        currentNodePermission: {
          commit: true,
          reversible: true,
          restartable: true,
          terminable: true,
          skippable: true,
        },
        mainBusiness: "ASSET_BUSINESS",
        doWorkflow: false,
        businessSubId: null,
        businessId: null,
        currentNodeInstanceId: null,
        production: [],
        reportNos: [],
        currentNodeInstanceCode: null,
        ifCheckTask: true,
        ifPay: null,
        doFourthCheck: false,
        ifProductionFund: false
      },
      currentNode: {
        flowId: null,
        pnodeId: null,
        nodeId: null,
        flowCode: null,
        nodeName: "",
        nodeCode: null,
        state: "",
        instanceId: null,
        sequence: null,
        restartable: null,
        reversible: null,
        skippable: null,
        terminable: null,
        tasks: []
      },
      assetsForm: {
        // 项目名
        name: null,
        // 客户经理id
        clientManagerId: this.$store.getters.userInfo.id,
        // 客户经理
        clientManagerName: this.$store.getters.userInfo.name,
        // 接单部门id
        departmentId: null,
        // 资产业务类型
        assetsBusinessGener: null,
        // 客户再次委托
        entrustAgain: null,
        // 客户类型（企业，个人）
        clienteleType: null,
        // 客户id
        clienteleId: null,
        // 业务来源（下级客户id）
        clienteleSubId: null,
        // 客户联系人id
        clienteleContactId: null,
        // 是否证券项目
        security: null,
        // 是否资产重组项目
        significantAssetsReorganization: null,
        // 是否国资项目
        stateAssets: null,
        // 是否涉及境外资产
        foreignAssetsInvolved: null,
        // 是否分配产值
        dispenseBenefit: null,
        // 委托人
        bailor: null,
        // 委托人地址
        bailorAddress: null,
        // 委托联系人姓名
        bailorContactName: null,
        // 委托人联系人电话
        bailorContactTel: null,
        // 终端客户id
        terminalClienteleId: null,
        // 终端客户类型
        terminalClienteleType: null,
        // 终端联系人id
        terminalClienteleContactId: null,
        // 备注
        remark: null,
        // 终端联系电话
        tmobile: null,
        // 分单类型
        allotType: "指派",
        // 项目成员
        members: null,
      },
      // 客户联系人信息
      linkmanInfo: {

      },
      // 终端联系人信息
      tLinkmanInfo: {

      },
      // 终端客户信息
      tCustomerInfo: {

      },
      // 
      pageParams: {
        back: null,
        row: null
      },
      // 业务类型下拉列表
      assetsBusinessGeners: [
        {
          value: '单项资产',
          label: '单项资产'
        }, {
          value: '整体资产',
          label: '整体资产'
        }, {
          value: '无形资产',
          label: '无形资产'
        }, {
          value: '债权',
          label: '债权'
        }, {
          value: '其他',
          label: '其他'
        }
      ],
      // 接单部门
      allotDepartment: [],
      // 客户信息
      customerCompany: [],
      // 业务信息(二级客户)
      subCustomerCompany: [],
      // 客户联系人下拉列表
      customerContract: [],
      // 终端客户下拉列表
      tCustomerCompany: [],
      // 终端联系人下拉列表
      tCustomerContract: [],
      // 项目负责人下拉列表
      principals: [],
      // 用户下拉列表
      allUsers: [],
      // 资产评估对象信息
      assetsEvaluationTarget: [],
      writeProductionStatementNos: [],
      writeProductionReportNos: [],
      // 估计对象总价
      totalEvaluateValue: 0.00,
      // 评估对象表单
      targetForm: {
        id: null,
        // 资产评估目的id
        evaluationPurposeId: null,
        // 资产评估对象类型一级id
        evaluationTypeId: null,
        // 资产评估对象类型二级id
        evaluationTypeSecId: null,
        // 产权持有人
        theHolder: null,
        // 资产价值类型id
        assetsValueId: null,
        // 项目负责人id
        principalId: null,
        // 实勘人id (json 可多个)
        siteIds: [],
        // 估价基准日
        valuationBasisDate: null,
        // 评估方法id
        evaluationMethodId: null,
        // 最终选择的评估方法id
        choiceEvaluationMethodId: null,
        // 总资产账面值(万)
        totalAssetCarryingAmount: null,
        // 总负债账面值(万)
        totalLiabilitiesCarryingAmount: null,
        // 净资产账面值(万)
        carryingAmountOfNetAssets: null,
        // 评估结论对应的评估值(万)
        estimatedValue: null,
        // 审核价格
        checkValue: null,
        // 资料路由信息
        filePath: [],
        // 资产业务id
        assetsId: null
      },
      targetFormBack: {
        evaluationPurposeId: null,
        evaluationTypeId: null,
        evaluationTypeSecId: null,
        theHolder: null,
        assetsValueId: null,
        principalId: null,
        siteIds: [],
        valuationBasisDate: null,
        evaluationMethodId: null,
        choiceEvaluationMethodId: null,
        totalAssetCarryingAmount: null,
        totalLiabilitiesCarryingAmount: null,
        carryingAmountOfNetAssets: null,
        estimatedValue: null,
        checkValue: null,
        filePath: [],
        assetsId: null
      },
      // 资产评估对象评估目的
      assetsEvaluationTargetPurpose: [],
      // 资产评估方法
      assetsEvaluationMethod: [],
      // 资产价值类型
      assetsValueType: [],
      // 资产评估对象类型
      assetsEvaluationTargetType: [],
      // 二级资产评估对象类型
      assetsSecEvaluationTargetType: [],
      // 评估对象弹窗可视状态
      targetDialogVisible: false,
      // 添加评估对象表单校验规则
      targetFormRules: {
        evaluationPurposeId: [
          { required: true, message: '请选择评估目的', trigger: 'change' }
        ],
        evaluationTypeId: [
          { required: true, message: '请选择评估对象', trigger: 'change' }
        ],
        evaluationTypeSecId: [
          { required: true, message: '请选择评估对象', trigger: 'change' }
        ],
        theHolder: [
          { required: true, message: '请填写产权持有人', trigger: 'blur' }
        ],
        assetsValueId: [
          { required: true, message: '请选择价值类型', trigger: 'change' }
        ],
        principalId: [
          { required: true, message: '请选择项目负责人', trigger: 'change' }
        ],
        siteIds: [
          { required: true, message: '请选择实勘人', trigger: 'change' }
        ],
        valuationBasisDate: [
          { required: true, message: '请选择价格基准日', trigger: 'change' }
        ],
        evaluationMethodId: [
          { required: true, message: '请选择评估方法', trigger: 'change' }
        ],
        choiceEvaluationMethodId: [
          { required: true, message: '请选择最终选择的评估方法', trigger: 'change' }
        ],
        totalAssetCarryingAmount: [
          { required: true, message: '请填写总资产账面值', trigger: 'blur' }
        ],
        totalLiabilitiesCarryingAmount: [
          { required: true, message: '请填写总负债账面值', trigger: 'blur' }
        ],
        carryingAmountOfNetAssets: [
          { required: true, message: '请填写净资产账面值', trigger: 'blur' }
        ],
        estimatedValue: [
          { required: true, message: '请填写评估结论对应的评估值', trigger: 'blur' }
        ],
        // filePath: [
        //   { required: true, message: '请上传附件资料', trigger: 'change' }
        // ],
        checkValue: [
          { required: true, message: '请填写审核价格', trigger: 'blur' }
        ]
      },
      // 款项信息
      invoiceData: {
        businessId: null,
        shouldAmount: null,
        realAmount: null,
        leftAmount: null,
        title: null,
        type: null,
        taxNo: null,
        bankName: null,
        bankAddress: null,
        bankTel: null
      },
      // 节点任务提交dto
      taskRecordDTO: {
        recordId: null,
        taskData: {}
      },
      pNode: null,
      // 产品选择表单可视状态
      productionChoiceDialogVisible: false,
      // 产品信息撰写表单可视状态
      productionWriteDialogVisible: false,
      // 评估对象审核定价表单可视状态
      checkValueDialogVisible: false,
      // isCheckValue: false,
      // 0：新增，1：更新
      productionChoiceStatus: 0,
      // 产品表单
      assetsProductionForm: {
        businessId: null,
        productionNo: null,
        productionType: null,
        signatory: [],
        clientName: null,
        clientTel: null,
        valuationBasisDate: null,
        evaluateAcreage: null,
        evaluatePrice: null,
        evaluateAmount: null,
        owner: null,
        printCount: null,
        createProductionDate: null,
        comment: null,
        filePath: [],
        assetsName: null
      },
      // 产品选择表单校验规则
      assetsProductionFormRules: {
        productionType: [
          { required: true, message: '请选择产品类型', trigger: 'change' }
        ],
        printCount: [
          { required: true, message: '请填写打印份数', trigger: 'blur' },
          { type: 'number', message: '请填写数字' }
        ],
        signatory: [
          { required: true, message: '请选择签字人', trigger: 'change' },
          { required: true, validator: checkSignatoryLength, trigger: 'change' }
        ],
        clientName: [
          { required: true, message: '请填写委托方名称', trigger: 'blur' }
        ],
        clientTel: [
          { required: true, message: '请填写委托方电话', trigger: 'blur' }
        ],
        valuationBasisDate: [
          { required: true, message: '请选择估价基准日', trigger: 'change' }
        ],
        // evaluateAcreage: [
        //   { required: true, message: '请填写评估面积', trigger: 'blur' }
        // ],
        // evaluatePrice: [
        //   { required: true, message: '请填写评估单价', trigger: 'blur' }
        // ],
        evaluateAmount: [
          { required: true, message: '请填写评估总价', trigger: 'blur' }
        ],
        owner: [
          { required: true, message: '请填写持有人', trigger: 'blur' }
        ],
        createProductionDate: [
          { required: true, message: '请选择产品出具日期', trigger: 'change' }
        ],
        filePath: [
          { required: true, message: '请上传附件资料', trigger: 'change' }
        ],
        assetsName: [
          { required: true, message: '请填写项目名称', trigger: 'change' }
        ],
        productionNo: [
          { required: true, message: '请选择评估对象', trigger: 'change' }
        ]
      },
      // 资产业务取号dto
      takeAssetsProductionNoDTO: {
        targetIdList: [],
        businessId: null,
        productionType: null,
        hasNotTakeNumTargetSelect: null,
        selectAll: null,
        printCount: null,
        statementNo: null
      },
      assetsProductionData: null,
      commitProductionNo: null,
      proInatanceCount: null,
      // 产品撰写表单禁用状态
      productionDisabledStatus: false,
      // 产品表单编辑类型
      writeType: null,
      // 产品质检表单可视状态
      productionCheckDialogVisible: false,
      // 产品质检信息
      productionPerformanceForm: {
        id: null,
        businessType: null,
        productionId: null,
        checkLoop: null,
        fatalMistake: 0,
        hardMistake: 0,
        normalMistake: 0,
        reason: null,
        checkId: null
      },
      // 产品入库弹窗
      warehouseDialog: false,
      scanEntryData: null,
      wareHouseProductionType: null,
      wareHouseproductionId: null,
      assetsAchievementRatioDialogVisible: false,
      // 项目所有参与人信息
      assetsBusinessMembers: [],
      // 资产绩效比例表单
      businessPerformanceDistributionForm: {
        businessId: null,
        businessType: null,
        reportNo: null,
        distributionList: [
          // {
          //   memberId: null,
          //   performanceDistribution: null
          // }
        ]
      },
      showDistributionButton: null
    }
  },
  watch: {

  },
  created() {
    this.disabledStatus = this.$route.query.disabledStatus === 'true';
    this.couldEdit = this.$route.query.couldEdit === 'true';
    this.couldBack = this.$route.query.couldBack === 'true';
    if (this.$route.query.activeTabName !== null && this.$route.query.activeTabName !== undefined) {
      this.activeTabName = this.$route.query.activeTabName;
    }
    this.nodeBusinessInfo.doWorkflow = true;
    // 获取页面参数
    this.pageParams.back = this.$route.query.back;
    this.pageParams.row = JSON.parse(this.$route.query.row);
    this.getProductionTypes(this.pageParams.row.assetsId);
    this.nodeBusinessInfo.mainBusiness = 'ASSET_BUSINESS';
    this.nodeBusinessInfo.businessId = this.pageParams.row.assetsId;
    this.nodeBusinessInfo.businessSubId = this.pageParams.row.statementNo;
    this.nodeBusinessInfo.businessMinId = this.pageParams.row.reportNo;
    this.getCurrentNodeInfo();
    this.getAllotDepartment();
    // this.getCustomerCompany(0);
    // this.getCustomerCompany(1);
    // this.getCustomerContract(0);
    // this.getCustomerContract(1);
    this.getAssetsDetailById(this.pageParams.row.assetsId);
    // this.getProductionByBusinessId(this.pageParams.row.assetsId);
    this.getAETargetListByAssetsId();
    this.nodeBusinessInfo.reportNos.push(this.pageParams.row.statementNo);
  },
  methods: {
    // 根据业务id获取资产业务详情
    getAssetsDetailById(id) {
      this.$api.assets.getAssetsDetailById(id).then(res => {
        if (res.code === 200) {
          this.assetsForm = res.data;
          this.$refs.board.getInstanceQueue();
          this.assetsForm.members = JSON.parse(res.data.members);
          this.initCustomerSelect(this.assetsForm.clienteleType);
          this.getPrincipalByAllotDepartment();
          this.getContactInfo();
          this.getAllUser();
        }
      })
    },
    handleChange() {

    },
    workflowCommitVerify(val, callback) {
      let commit = val.commit;
      let verify = new Object();
      verify.state = true;
      verify.cleanReport = false;
      verify.nextHandlerId = this.secondCheckUserId;
      if (commit.state === 'PASS') {
        let nodeCode = this.currentNode.nodeCode;
        switch (nodeCode) {
          case 'GENERATE_STATEMENT':
            let notTakeNumberTargets = this.assetsEvaluationTarget.filter(obj => !obj.productionNo).length;
            if (notTakeNumberTargets.length > 0) {
              this.$notify({
                title: '提示',
                message: '还有意见书号未取的估价对象，请先完成取号操作。',
                type: 'error',
                duration: 3000
              });
              verify.state = false;
              callback(verify);
              return;
            }
            if (typeof (commit.businessSubId) == 'undefined' || commit.businessSubId == null || commit.ifCheckTask == null) {
              this.$notify({
                title: '提示',
                message: '请选择一个产品后，再进行流程提交。',
                type: 'error',
                duration: 3000
              });
              verify.state = false;
              callback(verify);
              return;
            }
            if (this.proInatanceCount > 0) {
              this.$notify({
                title: '提示',
                message: '该产品已提交相应流程，不可重复提交。',
                type: 'error',
                duration: 3000
              });
              verify.state = false;
              callback(verify);
              return;
            }
            break;
          case 'WRITE_REPORT':
            let notTakeReportNoTargets = this.assetsEvaluationTarget.filter(function (e) {
              return e.reportNo == null;
            })
            if (notTakeReportNoTargets.length > 0) {
              this.$notify({
                title: '提示',
                message: '还有报告号未取的估价对象，请先完成取号操作。',
                type: 'error',
                duration: 3000
              });
              verify.state = false;
              callback(verify);
              return;
            }
            if (typeof (commit.businessMinId) == 'undefined' || commit.businessMinId == null || commit.ifCheckTask == null) {
              this.$notify({
                title: '提示',
                message: '请选择一个产品后，再进行流程提交。',
                type: 'error',
                duration: 3000
              });
              verify.state = false;
              callback(verify);
              return;
            }
            if (this.proInatanceCount > 0) {
              this.$notify({
                title: '提示',
                message: '该产品已提交相应流程，不可重复提交。',
                type: 'error',
                duration: 3000
              });
              verify.state = false;
              callback(verify);
              return;
            }
            break;
          case 'ASSET_REPORT_TAKE_NO':
            if (this.assetsEvaluationTarget.some(item => !item.reportNo)) {
              this.$notify({
                title: '提示',
                message: '还有评估对象未取号，请先完成取号再提交。',
                type: 'error',
                duration: 3000
              });
              verify.state = false;
              callback(verify);
              return;
            }
            break;
        }
        callback(verify);
      }
      let specialNodesForReverse = ["GENERATE_STATEMENT", "WRITE_REPORT", "ASSET_REPORT_TAKE_NO"];
      if (commit.state === 'REVERSE' && specialNodesForReverse.includes(this.currentNode.nodeCode)) {
        this.$refs.board.getPreviousNode();
        let reportNos = this.assetsEvaluationTarget.map(item => item.reportNo);
        //取了子号不能退回节点
        if (this.pNode.nodeCode === "QUOTATION_FEEDBACK" && reportNos[0].includes("-")) {
          this.$notify({
            title: '提示',
            message: '该订单已取了其他子号，不能退回节点。',
            type: 'info',
            duration: 3000
          });
          verify.state = false;
          verify.cleanReport = false;
          callback(verify);
        }
        if (this.pNode.nodeCode === "QUOTATION_FEEDBACK" && !reportNos[0].includes("-")) {
          verify.cleanReport = true;
          callback(verify);
        }
        callback(verify);
      }
    },
    goBack() {
      const back = this.$route.query.back
      if (back) {
        this.$router.push(back)
      }
    },
    handleClick(tab) {

    },
    // 改变客户类型时进行值重置的操作
    changeCustomerType(val) {
      // 清空联系人下拉列表
      this.assetsForm.clienteleContactId = null;
      this.assetsForm.clienteleSubId = null;
      this.customerContract = [];
      if (val === "企业") {
        this.getCustomerCompany(0);
        this.itemHideStatus = true;
      } else {
        this.getCustomerContract(1);
        this.itemHideStatus = false;
      }
    },
    initCustomerSelect(val) {
      if (val === "企业") {
        this.getCustomerCompany(0);
        // this.getCustomerContract();
        this.itemHideStatus = true;
      } else {
        // this.getCustomerContract(1);
        this.itemHideStatus = false;
      }
    },
    // 获取部门下拉列表
    getAllotDepartment() {
      this.$api.department.allot().then(res => {
        if (res.code === 200) {
          this.allotDepartment = res.data;
        }
      })
    },
    // 获取客户信息
    getCustomerCompany(val) {
      if (val === 0) {
        let simpleAll = new Object();
        simpleAll.terminal = val;
        this.$api.customerCompany.simpleAll(simpleAll).then(res => {
          if (res.code === 200) {
            this.customerCompany = res.data;
            this.findSubClientele(0);
          }
        })
      } else {
        let simpleAll = new Object();
        simpleAll.terminal = val;
        this.$api.customerCompany.simpleAll(simpleAll).then(res => {
          if (res.code === 200) {
            this.tCustomerCompany = res.data;
          }
        })
      }
    },
    // 打开新建客户联系人弹窗
    createLinkman(val) {
      // 打开前判断是否已经选择客户信息
      if (this.targetFassetsFormorm.clienteleType === "个人" || this.assetsForm.clienteleType != null && this.assetsForm.clienteleId != null && this.assetsForm.clienteleSubId != null) {
        this.createLinkmanVisible = true;
        this.linkmanForm.terminal = val;
        this.linkmanForm.clienteleType = this.assetsForm.clienteleType;
        this.linkmanForm.clienteleId = this.assetsForm.clienteleId;
        this.linkmanForm.clienteleSubId = this.assetsForm.clienteleSubId;
        if (this.assetsForm.clienteleType === '企业') {
          this.linkmanForm.ccId = this.assetsForm.clienteleSubId
        } else {
          this.assetsForm.clienteleSubId = 1;
          this.linkmanForm.ccId = this.assetsForm.clienteleSubId;
        }
      } else {
        this.$notify({
          title: '警告',
          message: '请先选择客户！',
          type: 'warning',
          duration: 2000
        });
      }

    },
    // 获取客户联系人列表
    getCustomerContract(val) {
      // if (this.assetsForm.clienteleSubId) {
      let simpleAll = new Object();
      simpleAll.terminal = 0;
      if (val === 1) {
        simpleAll.ccId = val;
      } else {
        simpleAll.ccId = this.assetsForm.clienteleSubId;
      }
      this.$api.customerLinkman.simpleAll(simpleAll).then(res => {
        if (res.code === 200) {
          this.customerContract = res.data;
        }
      })
      // }
    },
    // 获取二级客户信息(业务来源)
    findSubClientele(val) {
      if (val === 0) {
        if (this.assetsForm.clienteleId) {
          let simpleAll = new Object();
          simpleAll.terminal = val;
          simpleAll.parentId = this.assetsForm.clienteleId;
          this.$api.customerCompany.simpleAll(simpleAll).then(res => {
            if (res.code === 200) {
              this.subCustomerCompany = res.data;
            }
          })
        }
      } else {
        if (this.assetsForm.terminalClienteleId) {
          let simpleAll = new Object();
          simpleAll.terminal = val;
          simpleAll.ccId = this.assetsForm.terminalClienteleId;
          this.$api.customerCompany.detail(this.assetsForm.terminalClienteleId).then(res => {
            if (res.code === 200) {
              this.assetsForm.tmobile = res.data.phone;
            }
          })
        }
      }
    },
    // 打开新增终端客户弹窗
    createTerminalClient() {
      this.createTerminalClientVisible = true;
    },
    // 根据部门id获取项目负责人列表
    getPrincipalByAllotDepartment() {
      let departmentId = this.assetsForm.departmentId;
      if (departmentId) {
        this.$api.user.usersByDepartmentId(departmentId).then(res => {
          if (res.code === 200) {
            this.principals = res.data;
          }
        })
      }
    },
    // 获取用户下拉列表
    getAllUser() {
      this.$api.user.simpleAll().then(res => {
        if (res.code === 200) {
          this.allUsers = res.data;
        }
      })
    },
    // 获取流程节点信息
    getCurrentNodeInfo() {
      if (this.pageParams.row.assetsId) {
        this.$api.workNodeInstance.currentNode({ "mainBusiness": "ASSET_BUSINESS", "businessId": this.pageParams.row.assetsId, "businessSubId": this.pageParams.row.statementNo, "businessMinId": this.pageParams.row.reportNo }).then(res => {
          if (res.code === 200) {
            if (res.data) {
              this.currentNode = res.data;
              this.nodeBusinessInfo.currentInstanceNodeId = res.data.instanceId;
              this.nodeBusinessInfo.currentNodeInstanceCode = res.data.nodeCode;
              this.nodeBusinessInfo.currentNodePermission.restartable = res.data.restartable;
              this.nodeBusinessInfo.currentNodePermission.reversible = res.data.reversible;
              this.nodeBusinessInfo.currentNodePermission.skippable = res.data.skippable;
              this.nodeBusinessInfo.currentNodePermission.terminable = res.data.terminable;
              // this.nodeBusinessInfo.businessId = this.pageParams.row.assetsId;

              if (this.currentNode.nodeCode === 'REPORT_IN') {
                this.getProductionRealAmount(this.pageParams.row.reportNo);
              }
            }
          }
        })
      }
    },
    // 修改项目负责人与项目成员信息
    updatePrincipalAndMembers() {
      let assetsPrincipalMembers = new Object();
      assetsPrincipalMembers.id = this.assetsForm.id;
      assetsPrincipalMembers.principalId = this.assetsForm.principalId;
      assetsPrincipalMembers.departmentId = this.assetsForm.departmentId;
      assetsPrincipalMembers.members = JSON.stringify(this.assetsForm.members);
      this.taskRecordDTO.recordId = this.currentNode.tasks[0].recordId;
      this.taskRecordDTO.taskData = assetsPrincipalMembers;
      if (assetsPrincipalMembers.id && assetsPrincipalMembers.principalId && assetsPrincipalMembers.departmentId && this.assetsForm.members.length > 0) {
        this.$api.assets.updatePrincipalAndMembers(this.taskRecordDTO).then(res => {
          if (res.code === 200 && res.data) {
            this.$notify({
              title: '成功',
              message: '保存成功,请提交节点继续流程。',
              type: 'success',
              duration: 2000
            });
          }
        })
      } else {
        this.$notify({
          title: '警告',
          message: '请先完善项目负责人与项目成员信息！',
          type: 'error',
          duration: 2000
        });
      }

    },
    // 根据节点返回不同的操作按钮信息
    hanlderType() {
      if (this.currentNode) {
        if (this.currentNode.nodeCode === 'SPOT_RECONNAISSANCE') {
          return "编辑";
        }
        if (this.currentNode.nodeCode === 'INITIAL_PRICE') {
          return "定价";
        }
        if (this.currentNode.nodeCode === 'REVIEW_QUOTATION') {
          return "审核定价";
        }
        return "查看";

      }
    },
    // 根据资产业务id获取资产业务评估对象集合
    getAETargetListByAssetsId(productionNo) {
      let aETargetListSelectDTO = new Object();
      aETargetListSelectDTO.businessId = this.pageParams.row.assetsId;
      // if (productionNo != null || productionNo != undefined || productionNo != '') {
      //   aETargetListSelectDTO.statementNo = productionNo;
      //   aETargetListSelectDTO.reportNo = productionNo;
      // } else {
      aETargetListSelectDTO.statementNo = this.pageParams.row.statementNo;
      aETargetListSelectDTO.reportNo = this.pageParams.row.reportNo;
      // }
      this.$api.assets.getAETargetListByAssetsId(aETargetListSelectDTO).then(res => {
        if (res.code === 200 && res.data !== null) {
          this.assetsEvaluationTarget = res.data;
          this.writeProductionStatementNos = this.assetsEvaluationTarget
            // 过滤
            .filter(obj => obj.statementCreateProductionDate == null || obj.statementCreateProductionDate == '')
            // 获取
            .map(obj => obj.statementNo)
            // 去重
            .filter((value, index, self) => self.indexOf(value) === index);
          this.writeProductionReportNos = this.assetsEvaluationTarget
            // 过滤
            .filter(obj => obj.reportCreateProductionDate == null || obj.reportCreateProductionDate == '')
            // 获取
            .map(obj => obj.reportNo)
            // 去重
            .filter((value, index, self) => self.indexOf(value) === index);
          this.flowDoFourthCheck();
          // 获取资产产品列表
          this.getProductionList();
        }
      })
    },
    // 获取所有资产评估目的集合
    getPurpose() {
      this.$api.assets.getPurpose().then(res => {
        if (res.code === 200) {
          this.assetsEvaluationTargetPurpose = res.data;
        }
      })
    },
    // 获取所有评估方法集合
    getAssetsEvaluationMethod() {
      this.$api.assets.getAssetsEvaluationMethod().then(res => {
        if (res.code === 200) {
          this.assetsEvaluationMethod = res.data;
        }
      })
    },
    // 获取所有资产价值类型
    getAssetsValueType() {
      this.$api.assets.getAssetsValueType().then(res => {
        if (res.code === 200) {
          this.assetsValueType = res.data;
        }
      })
    },
    // 根据父级id获取资产评估对象类型(id可为空)
    getTypeList(val, level) {
      let parentId = val;
      // 每次进入方法清空二级下拉选择
      // this.targetForm.evaluationTypeSecId = null;
      this.assetsSecEvaluationTargetType = [];
      this.$api.assets.getTypeList(parentId).then(res => {
        if (res.code === 200) {
          if (level == 1) {
            // 等级为1赋值给assetsEvaluationTargetType
            this.assetsEvaluationTargetType = res.data;
          } else {
            // 其他赋值给assetsEvaluationTargetType
            this.assetsSecEvaluationTargetType = res.data;
          }
        }
      })
    },
    // 打开新增评估对象弹窗表单
    openTargetDialog() {
      // 可视状态为true
      this.targetDialogVisible = true;
      // 初始表单所需信息
      this.targetForm.principalId = this.assetsForm.principalId;
      this.targetForm.siteIds = this.assetsForm.members;
      if (this.assetsEvaluationTargetPurpose.length == 0 || this.assetsEvaluationMethod.length == 0 || this.assetsValueType.length == 0 || this.assetsEvaluationTargetType.length == 0) {
        this.getPurpose();
        this.getAssetsEvaluationMethod();
        this.getAssetsValueType();
        this.getTypeList(0, 1);
      }

    },
    // 文件选择改变触发事件
    changeresTarget(res, file, fileList) {
      // 上传成功向表单附件信息数组添加信息
      if (res.code === 200) {
        this.targetForm.filePath.push({ name: file.name, url: res.data.url });
      } else {
        this.$notify({
          title: '错误',
          message: '电子文档上传失败',
          type: 'error',
          duration: 2000
        });
      }

    },
    changeresProduction(res, file, fileList) {
      // 上传成功向表单附件信息数组添加信息
      if (res.code === 200) {
        this.assetsProductionForm.filePath.push({ name: file.name, url: res.data.url });
      } else {
        this.$notify({
          title: '错误',
          message: '电子文档上传失败',
          type: 'error',
          duration: 2000
        });
      }

    },
    // 文件上传数量限制
    handleExceed() {
      this.$message.warning(`当前限制选择 3个文件！`);
    },
    // 打开Windows文件选择器
    handleAttachmentPreview(file) {
      window.open(file.url)
    },
    // 移除文件
    beforeRemove(file, fileList) {
      fileList = fileList.filter((o) => {
        return o.name !== file.name
      });
      this.targetForm.filePath = this.targetForm.filePath.filter((o) => {
        return o.name !== file.name
      });
    },
    // 移除文件
    beforeRemovePro(file, fileList) {
      fileList = fileList.filter((o) => {
        return o.name !== file.name
      });
      this.assetsProductionForm.filePath = this.assetsProductionForm.filePath.filter((o) => {
        return o.name !== file.name
      });
    },
    resettargetForm() {
      this.targetForm = this.targetFormBack;
      this.fileList = [];
    },
    clear() {
      if (this.$refs.targetForm !== undefined) {
        this.$refs.targetForm.clearValidate();
      }
    },
    // 保存新增资产业务评估对象
    assetsTargetSave() {
      this.$refs.targetForm.validate(valid => {
        if (valid) {
          this.targetForm.assetsId = this.assetsForm.id;
          this.targetForm.siteIds = JSON.stringify(this.targetForm.siteIds);
          this.targetForm.filePath = JSON.stringify(this.targetForm.filePath);
          this.taskRecordDTO.recordId = this.currentNode.tasks[0].recordId;
          this.taskRecordDTO.taskData = this.targetForm;
          this.$api.assets.assetsTargetSave(this.taskRecordDTO).then(res => {
            if (res.code === 200) {
              this.$notify({
                title: '成功',
                message: '添加资产业务评估对象成功，可继续添加或提交节点',
                type: 'success',
                duration: 2000
              });
              setTimeout(() => {
                this.targetDialogVisible = false;
                //获取评估对象列表
                this.getAETargetListByAssetsId();
              }, 1000);

            }
          })
        }
      })
    },
    // 根据id获取资产评估对象详情
    getAssetsTargetDetail(id) {
      this.$api.assets.getAssetsTargetDetail(id).then(res => {
        if (res.code === 200) {
          this.targetForm = res.data;
          this.targetForm.siteIds = JSON.parse(res.data.siteIds);
          this.targetForm.filePath = JSON.parse(res.data.filePath);
          this.fileList = this.targetForm.filePath
          this.getTypeList(this.targetForm.evaluationTypeId, 2);
          this.openTargetDialog();
        }
      })
    },
    // 更新资产评估对象
    assetsTargetUpdate() {
      this.$refs.targetForm.validate(valid => {
        if (valid) {
          this.targetForm.assetsId = this.assetsForm.id;
          this.targetForm.siteIds = JSON.stringify(this.targetForm.siteIds);
          this.targetForm.filePath = JSON.stringify(this.targetForm.filePath);
          this.$api.assets.assetsTargetUpdate(this.targetForm).then(res => {
            if (res.code === 200) {
              this.$notify({
                title: '成功',
                message: '更新资产业务评估对象成功！',
                type: 'success',
                duration: 2000
              });
              setTimeout(() => {
                this.targetDialogVisible = false;
                //获取评估对象列表
                this.getAETargetListByAssetsId();
              }, 1000);
            }
          })
        }
      })
    },
    // 删除资产评估对象
    assetsTargetDelete(id) {
      this.$api.assets.assetsTargetDelete(id).then(res => {
        if (res.code === 200) {
          this.$notify({
            title: '成功',
            message: '删除资产业务评估对象成功！',
            type: 'success',
            duration: 2000
          });
          this.getAETargetListByAssetsId();
        }
      })
    },
    // 根据不同情况打开的评估对象表单可编辑状态不同
    changeStatus(val) {
      if (val == "edit") {
        this.targetDisabledStatus = false;
        this.updateButtonStatus = true;
        this.saveButtonStatus = false;
      } else if (val == "add") {
        this.targetDisabledStatus = false;
        this.saveButtonStatus = true;
        this.updateButtonStatus = false;
      } else if (val == "detail") {
        this.targetDisabledStatus = true;
        this.saveButtonStatus = false;
        this.updateButtonStatus = false;
      }
    },
    // 根据业务id获取资产业务款项信息
    getOrderFundInvoiceById() {
      this.$api.assets.getOrderFundInvoiceById(this.assetsForm.id).then(res => {
        if (res.code === 200) {
          if (res.data != null) {
            this.invoiceData = res.data;
            this.invoiceData.leftAmount = this.invoiceData.shouldAmount - this.invoiceData.realAmount;
          }
        }
      })
    },
    // 获取产品信息类型
    getProductionTypes(id) {
      this.$api.assets.getProductionTypes(id).then(res => {
        if (res.code === 200) {
          this.nodeBusinessInfo.production = res.data;
        }
      })
    },
    // 提交节点
    commit(state) {
      this.$refs.board.commit(state);
    },
    getPreviousNode(pNode) {
      this.pNode = pNode;
    },
    // 打开产品选择表单弹窗
    openProductionDialog() {
      this.productionChoiceDialogVisible = true;
      // this.getProductionByBusinessId(this.pageParams.row.assetsId);
      this.getChoiceLog();
    },
    // 获取产品选择记录
    getChoiceLog() {
      let selectDTO = {};
      selectDTO.businessType = 'ASSET_BUSINESS';
      selectDTO.businessId = this.pageParams.row.assetsId;
      selectDTO.targetId = this.assetsEvaluationTarget[0].id;
      this.$api.businessProductionChoiceLog.getChoiceLog(selectDTO).then(res => {
        if (res.code == 200 && res.data !== null) {
          this.productionChoiceStatus = 1;
          this.assetsProductionForm.id = res.data.productionId;
          this.assetsProductionForm.productionType = res.data.productionType;
          this.assetsProductionForm.printCount = res.data.printCount;
        }
      })
    },
    // 根据业务id获取是否已选择产品
    // getProductionByBusinessId(id) {
    //   this.$api.assets.getProductionByBusinessId(id).then(res => {
    //     if (res.code === 200) {
    //       // 产品信息不为null,则证明已经选择过产品,将按钮改为修改
    //       if (res.data !== null) {
    //         if (res.data.productionType == 'STATEMENT' && (this.currentNode.nodeCode === 'PRODUCT_CHOICE' || this.currentNode.nodeCode === 'GENERATE_STATEMENT')) {
    //           this.assetsProductionForm = res.data;
    //           this.productionChoiceStatus = 1;
    //         }
    //         if (res.data.productionType !== 'STATEMENT' && (this.currentNode.nodeCode === 'REPORT_CHOICE' || this.currentNode.nodeCode === 'ASSET_REPORT_TAKE_NO')) {
    //           this.assetsProductionForm = res.data;
    //           this.productionChoiceStatus = 1;
    //         }
    //       }
    //     }
    //   })
    // },
    // 选择产品,新增产品信息
    assetsProductionSave() {
      this.$refs.assetsProductionForm.validate(valid => {
        if (valid) {
          this.assetsProductionForm.businessId = this.assetsForm.id;
          // if (this.assetsProductionForm.productionType == 1) {
          //   // 价值意见书
          //   this.assetsProductionForm.productionType = 'STATEMENT';
          // } else if (this.assetsProductionForm.productionType == 4) {
          //   // 意见函
          //   this.assetsProductionForm.productionType = 'LETTER';
          // } else if (this.assetsProductionForm.productionType == 2) {
          //   // 咨询报告
          //   this.assetsProductionForm.productionType = 'CONSULT';
          // } else {
          //   // 评估报告
          //   this.assetsProductionForm.productionType = 'REPORT';
          // }
          this.assetsProductionForm.filePath = JSON.stringify(this.assetsProductionForm.filePath);
          this.assetsProductionForm.signatory = JSON.stringify(this.assetsProductionForm.signatory);
          this.assetsProductionForm.targetIdList = this.assetsEvaluationTarget.map(item => item.id);
          this.taskRecordDTO.recordId = this.currentNode.tasks[0].recordId;
          this.taskRecordDTO.taskData = this.assetsProductionForm;
          this.$api.assets.assetsProductionSave(this.taskRecordDTO).then(res => {
            if (res.code === 200) {
              this.$notify({
                title: '成功',
                message: '选择产品成功！请继续提交流程节点！',
                type: 'success',
                duration: 2000
              });
              this.getProductionTypes(this.assetsForm.id);
              this.productionChoiceDialogVisible = false;
              this.$refs.assetsProductionForm.resetFields();
            }
          })
        }
      })
    },
    // 选择产品,更新已选择产品信息
    assetsProductionUpdateChoice() {
      this.$refs.assetsProductionForm.validate(valid => {
        if (valid) {
          this.assetsProductionForm.businessId = this.assetsForm.id;
          // if (this.assetsProductionForm.productionType == 1) {
          //   // 价值意见书
          //   this.assetsProductionForm.productionType = 'STATEMENT';
          // } else if (this.assetsProductionForm.productionType == 4) {
          //   // 意见函
          //   this.assetsProductionForm.productionType = 'LETTER';
          // } else {
          //   // 报告
          //   this.assetsProductionForm.productionType = 'REPORT';
          // }
          this.assetsProductionForm.filePath = JSON.stringify(this.assetsProductionForm.filePath);
          this.assetsProductionForm.signatory = JSON.stringify(this.assetsProductionForm.signatory);
          this.assetsProductionForm.targetIdList = this.assetsEvaluationTarget.map(item => item.id);
          this.taskRecordDTO.recordId = this.currentNode.tasks[0].recordId;
          this.taskRecordDTO.taskData = this.assetsProductionForm;
          this.$api.assets.assetsProductionUpdateChoice(this.taskRecordDTO).then(res => {
            if (res.code === 200) {
              this.$notify({
                title: '成功',
                message: '选择产品成功！请继续提交流程节点！',
                type: 'success',
                duration: 2000
              });
              this.getProductionTypes(this.assetsForm.id);
              this.productionChoiceDialogVisible = false;
              this.$refs.assetsProductionForm.resetFields();
            }
          })
        }
      })
    },
    // 资产产品意见书取号
    takeAssetsStatementProductionNo() {
      this.takeAssetsProductionNoDTO.allTargetIdList = this.assetsEvaluationTarget.map(item => item.id);
      // 提交的要取号数组长度与table长度一致则是全部取号
      // if (this.takeAssetsProductionNoDTO.targetIdList.length === this.assetsEvaluationTarget.length) {
      //   this.takeAssetsProductionNoDTO.selectAll = true;
      // } else {
      //   this.takeAssetsProductionNoDTO.selectAll = false;
      // }

      // 判断表格中是否还有未选择且未取号的评估对象,返回布尔
      let notTakeNumTargetSelect = this.assetsEvaluationTarget.filter(item => !this.takeAssetsProductionNoDTO.targetIdList.includes(item.id));
      this.takeAssetsProductionNoDTO.hasNotTakeNumTargetSelect = notTakeNumTargetSelect.some(target => target.statementNo === null || target.statementNo === '');

      this.takeAssetsProductionNoDTO.businessId = this.assetsForm.id;
      // this.getProductionByBusinessId(this.assetsForm.id);
      // this.takeAssetsProductionNoDTO.productionType = this.assetsProductionForm.productionType;
      // this.takeAssetsProductionNoDTO.productionType = this.nodeBusinessInfo.production[this.nodeBusinessInfo.production.length - 1];
      // this.takeAssetsProductionNoDTO.printCount = this.assetsProductionForm.printCount;

      if (!this.takeAssetsProductionNoDTO.targetIdList.length == 0) {
        this.$api.assets.takeAssetsStatementProductionNo(this.takeAssetsProductionNoDTO).then(res => {
          if (res.code === 200 && res.data) {
            this.$notify({
              title: '成功',
              message: '产品取号成功！',
              type: 'success',
              duration: 2000
            });
            // this.pageParams.row.productionNo = res.data;
            this.getAETargetListByAssetsId();
          }
        })
      } else {
        this.$notify({
          title: '警告',
          message: '您必须选择至少一个评估对象！',
          type: 'warning',
          duration: 2000
        });
      }

    },
    // 资产产品报告取号
    takeAssetsReportProductionNo() {
      this.takeAssetsProductionNoDTO.allTargetIdList = this.assetsEvaluationTarget.map(item => item.id);
      this.takeAssetsProductionNoDTO.statementNo = this.assetsEvaluationTarget[0].statementNo;
      // 提交的要取号数组长度与table长度一致则是全部取号
      // if (this.takeAssetsProductionNoDTO.targetIdList.length === this.assetsEvaluationTarget.length) {
      //   this.takeAssetsProductionNoDTO.selectAll = true;
      // } else {
      //   this.takeAssetsProductionNoDTO.selectAll = false;
      // }

      // 判断表格中是否还有未选择且未取号的评估对象,返回布尔
      let notTakeNumTargetSelect = this.assetsEvaluationTarget.filter(item => !this.takeAssetsProductionNoDTO.targetIdList.includes(item.id));
      this.takeAssetsProductionNoDTO.hasNotTakeNumTargetSelect = notTakeNumTargetSelect.some(target => target.reportNo === null || target.reportNo === '');

      this.takeAssetsProductionNoDTO.businessId = this.assetsForm.id;
      // this.getProductionByBusinessId(this.assetsForm.id);
      // this.takeAssetsProductionNoDTO.productionType = this.assetsProductionForm.productionType;
      // this.takeAssetsProductionNoDTO.productionType = this.nodeBusinessInfo.production[this.nodeBusinessInfo.production.length - 1];
      // this.takeAssetsProductionNoDTO.printCount = this.assetsProductionForm.printCount;

      this.taskRecordDTO.recordId = this.currentNode.tasks[0].recordId;
      this.taskRecordDTO.taskData = this.takeAssetsProductionNoDTO;

      if (!this.takeAssetsProductionNoDTO.targetIdList.length == 0) {
        this.$api.assets.takeAssetsReportProductionNo(this.taskRecordDTO).then(res => {
          if (res.code === 200 && res.data) {
            this.$notify({
              title: '成功',
              message: '产品取号成功！',
              type: 'success',
              duration: 2000
            });
            // this.pageParams.row.productionNo = res.data;
            this.getAETargetListByAssetsId();
          }
        })
      } else {
        this.$notify({
          title: '警告',
          message: '您必须选择至少一个评估对象！',
          type: 'warning',
          duration: 2000
        });
      }

    },
    // 资产评估对象选取数据处理
    targetSelectionChange(val) {
      this.takeAssetsProductionNoDTO.targetIdList = val;
      this.takeAssetsProductionNoDTO.targetIdList = this.takeAssetsProductionNoDTO.targetIdList.map(selection => selection.id);
    },
    // 判断行数据是否可选
    selectable(row) {
      if (row.statementNo != null && row.statementNo != '' && this.currentNode.nodeCode !== 'ASSET_REPORT_TAKE_NO') {
        return false;
      } else if (row.reportNo != null && row.reportNo != '' && this.currentNode.nodeCode !== 'GENERATE_STATEMENT') {
        return false;
      } else {
        return true;
      }
    },
    openWriteProductionDialog(status, type) {
      this.productionWriteDialogVisible = true;
      this.productionDisabledStatus = status;
      this.writeType = type;
    },
    // 根据业务id与产品号获取资产产品信息并初始化表单
    getAssetsProductionDetailByNo() {
      let assetsProductionDetailDTO = new Object();
      assetsProductionDetailDTO.businessId = this.assetsForm.id;
      assetsProductionDetailDTO.productionNo = this.assetsProductionForm.productionNo;
      this.$api.assets.getAssetsProductionDetailByNo(assetsProductionDetailDTO).then(res => {
        if (res.code == 200 && res.data !== null) {
          this.assetsProductionForm.productionType = res.data.productionType
          this.assetsProductionForm.printCount = res.data.printCount;
          this.assetsProductionForm.clientName = this.assetsForm.bailorContactName;
          this.assetsProductionForm.clientTel = this.assetsForm.bailorContactTel;
          this.assetsProductionForm.assetsName = this.assetsForm.name;
          this.assetsProductionForm.owner = this.assetsEvaluationTarget.find(obj => obj.productionNo === assetsProductionDetailDTO.productionNo)?.theHolder;
          this.assetsProductionForm.valuationBasisDate = this.assetsEvaluationTarget[0].valuationBasisDate;
          this.assetsProductionForm.filePath = [];
          this.assetsProductionForm.signatory = [];
        }
      })
    },
    // 当产品单价或面积改变时触发
    computeAmount() {
      this.assetsProductionForm.evaluateAmount = (this.assetsProductionForm.evaluatePrice * this.assetsProductionForm.evaluateAcreage) / 10000;
    },
    // 资产撰写产品(意见书和报告都是这个接口)
    writeAssetsProduction() {
      this.$refs.assetsProductionForm.validate(valid => {
        if (valid) {
          this.assetsProductionForm.filePath = JSON.stringify(this.assetsProductionForm.filePath);
          if (this.assetsProductionForm.signatory !== null) {
            this.assetsProductionForm.signatory = JSON.stringify(this.assetsProductionForm.signatory);
          } else {
            this.assetsProductionForm.signatory = null;
          }
          this.assetsProductionForm.businessId = this.assetsForm.id;
          this.taskRecordDTO.recordId = this.currentNode.tasks[0].recordId;
          this.taskRecordDTO.taskData = this.assetsProductionForm;
          this.$api.assets.writeAssetsProduction(this.taskRecordDTO).then(res => {
            if (res.code == 200) {
              this.$notify({
                title: '成功',
                message: '产品撰写成功！请继续提交流程节点！',
                type: 'success',
                duration: 2000
              });
            }
            this.getAETargetListByAssetsId(this.assetsProductionForm.productionNo);
            this.productionWriteDialogVisible = false;
            this.getProductionList();
            this.writeProductionReportNos = [];
            this.writeProductionStatementNos = [];
          })
        }
      })

    },
    resetProductionForm() {
      this.fileList = [];
    },
    // 根据业务id与产品号查询产品信息
    getProductionList() {
      let aProListSelectDTO = new Object();
      aProListSelectDTO.businessId = this.pageParams.row.assetsId;
      // aProListSelectDTO.statementNo = this.pageParams.row.statementNo;
      // aProListSelectDTO.reportNo = this.pageParams.row.reportNo;
      // if (this.currentNode.nodeCode == 'WRITE_REPORT' && this.assetsEvaluationTarget[0].statementNo !== null) {
      // aProListSelectDTO.reportNo = this.assetsEvaluationTarget[0].reportNo;
      //获取评估对象中取的号
      aProListSelectDTO.statementNos = this.assetsEvaluationTarget.filter(obj => obj.statementNo !== null && obj.statementNo !== '').map(obj => obj.statementNo);
      aProListSelectDTO.reportNos = this.assetsEvaluationTarget.filter(obj => obj.reportNo !== null && obj.reportNo !== '').map(obj => obj.reportNo);
      // }
      if (aProListSelectDTO.statementNos.length > 0 || aProListSelectDTO.reportNos.length > 0) {
        this.$api.assets.getProductionList(aProListSelectDTO).then(res => {
          if (res.code == 200) {
            this.assetsProductionData = res.data;
            this.assetsProductionData = this.assetsProductionData.map(item => {
              // 检查 filePath 是否为字符串且不为空
              if (typeof item.filePath === 'string' && item.filePath.trim() !== '') {
                try {
                  // 使用 JSON.parse 解析 filePath 字符串
                  item.filePath = JSON.parse(item.filePath);
                } catch (error) {
                  console.error('解析 filePath 时发生错误：', error);
                }
              }
              // 返回更新后的对象
              return item;
            });
          }
        })
      }
    },
    //选择要提交节点的产品号
    pushProductionNo() {
      // 查询该产品是否已有提交的流程
      let aProListSelectDTO = { businessId: null, productionNo: null, productionNos: [] };

      this.nodeBusinessInfo.reportNos = [];
      this.nodeBusinessInfo.reportNos.push(this.commitProductionNo);
      if (this.currentNode.nodeCode == 'GENERATE_STATEMENT') {
        this.nodeBusinessInfo.businessSubId = this.commitProductionNo;
        aProListSelectDTO.productionNos = this.assetsProductionData.filter(obj => obj.productionType == 'STATEMENT').map(obj => obj.productionNo);
      }
      if (this.currentNode.nodeCode == 'WRITE_REPORT') {
        this.nodeBusinessInfo.businessMinId = this.commitProductionNo;
        aProListSelectDTO.productionNos = this.assetsProductionData.filter(obj => obj.productionType !== 'STATEMENT').map(obj => obj.productionNo);
      }


      aProListSelectDTO.businessId = this.assetsForm.id;
      aProListSelectDTO.productionNo = this.commitProductionNo;
      this.$api.assets.getInatanceCount(aProListSelectDTO).then(res => {
        if (res.code == 200) {
          this.proInatanceCount = res.data;
        }
      })

      //判断是否还有未撰写或未提交的产品(false:无,提交时完成节点 true:有,提交时不完成节点)
      let isNotWriteAllPro = true;
      if (this.currentNode.nodeCode === 'GENERATE_STATEMENT') {
        isNotWriteAllPro = this.assetsEvaluationTarget.some(obj =>
          (obj.statementCreateProductionDate === null || obj.statementCreateProductionDate === '')
        );
      }
      if (this.currentNode.nodeCode === 'WRITE_REPORT') {
        isNotWriteAllPro = this.assetsEvaluationTarget.some(obj =>
          (obj.reportCreateProductionDate === null || obj.reportCreateProductionDate === '')
        );
      }

      // 判断是否完成节点
      if (isNotWriteAllPro) { // 还有未撰写或未提交产品不完成节点
        this.nodeBusinessInfo.ifCheckTask = false;
      } else {
        this.$api.assets.getInatanceCountList(aProListSelectDTO).then(res => {
          if (res.code == 200) {
            // 未提交的同类型产品大于1时,不完成节点
            if (res.data.filter(count => count === 0).length > 1) {
              this.nodeBusinessInfo.ifCheckTask = false;
            } else {
              this.nodeBusinessInfo.ifCheckTask = true;
            }
          } else {
            this.nodeBusinessInfo.ifCheckTask = true;
          }
        })

      }

    },
    // 打开审核定价弹窗表单
    openCheckValueDialog(id) {
      this.checkValueDialogVisible = true;
      this.$api.assets.getAssetsTargetDetail(id).then(res => {
        if (res.code === 200) {
          this.targetForm = res.data;
        }
      })
      this.getAssetsEvaluationMethod()
    },
    // 评估对象审核定价
    checkValue() {
      this.$refs.targetForm.validate(valid => {
        if (valid) {
          this.$api.assets.checkValue(this.targetForm).then(res => {
            if (res.code == 200) {
              this.$notify({
                title: '成功',
                message: '审核定价已完成！',
                type: 'success',
                duration: 2000
              });
              this.checkValueDialogVisible = false;
              this.getAETargetListByAssetsId();
              // this.isCheckValue = true;
            }
          })
        }
      })
    },
    // 根据产品id获取产品详情
    getAssetsProductionDetail(id) {
      this.$api.assets.getAssetsProductionDetail(id).then(res => {
        if (res.code == 200) {
          this.assetsProductionForm = res.data;
          this.assetsProductionForm.filePath = JSON.parse(res.data.filePath);
          this.fileList = this.assetsProductionForm.filePath;
          this.productionWriteDialogVisible = true;
        }
      })
    },
    // 更新产品信息
    productionUpdate() {
      this.$refs.assetsProductionForm.validate(valid => {
        if (valid) {
          this.assetsProductionForm.filePath = JSON.stringify(this.assetsProductionForm.filePath);
          if (this.assetsProductionForm.signatory !== null) {
            this.assetsProductionForm.signatory = JSON.stringify(this.assetsProductionForm.signatory);
          } else {
            this.assetsProductionForm.signatory = null;
          }
          this.$api.assets.productionUpdate(this.assetsProductionForm).then(res => {
            if (res.code == 200) {
              this.$notify({
                title: '成功',
                message: '产品修改成功！',
                type: 'success',
                duration: 2000
              });
            }
            this.getAETargetListByAssetsId();
            this.productionWriteDialogVisible = false;
            this.getProductionList();
          })
        }
      })
    },
    // 根据业务类型,产品id及checkLoop获取质检信息
    openProductionCheckDialog() {
      this.$api.assets.getAssetsProductionDetail(this.productionPerformanceForm.productionId).then(res => {
        if (res.code == 200) {
          this.assetsProductionForm = res.data;
          this.assetsProductionForm.filePath = JSON.parse(res.data.filePath);
          this.fileList = this.assetsProductionForm.filePath;
        }
      })
      const curNode = this.currentNode.nodeCode;
      if (curNode === 'REVIEW_STATEMENT' || curNode === 'CHECK_REPORT') {
        if (this.assetsEvaluationTarget.some(item => !item.checkValue)) {
          this.$notify({
            title: '警告',
            message: '评估对象需要进行审核定价',
            type: 'error',
            duration: 3000
          });
        } else {
          this.initProQuality(curNode);
        }
      } else {
        this.initProQuality(curNode);
      }
    },
    // 质检信息基础信息赋值
    initProQuality(curNode) {
      this.productionCheckDialogVisible = true;
      this.productionPerformanceForm.businessType = 'ASSET_BUSINESS';
      if (curNode === 'REVIEW_STATEMENT' || curNode === 'CHECK_REPORT') {
        this.productionPerformanceForm.checkLoop = "初审";
      }
      if (curNode === 'REEXAMINE_STATEMENT' || curNode === 'RECHECK_REPORT') {
        this.productionPerformanceForm.checkLoop = "复审";
      }
      if (curNode === 'FOURTH_CHECK_REPORT') {
        this.productionPerformanceForm.checkLoop = "四审";
      }
      this.$api.businessProductionPerformance.getProductionPerformance(this.productionPerformanceForm).then(res => {
        if (res.code === 200 && res.data !== null) {
          this.productionPerformanceForm.id = res.data.id;
          this.productionPerformanceForm.fatalMistake = res.data.fatalMistake;
          this.productionPerformanceForm.hardMistake = res.data.hardMistake;
          this.productionPerformanceForm.normalMistake = res.data.normalMistake;
          this.productionPerformanceForm.reason = res.data.reason;
        }
      })
    },
    // 保存产品质检信息(新增与保存都是这个方法)
    saveQuality() {
      if ((this.productionPerformanceForm.hardMistake + this.productionPerformanceForm.fatalMistake + this.productionPerformanceForm.normalMistake) > 0) {
        if (this.productionPerformanceForm.reason !== null && this.productionPerformanceForm.reason !== '') {

          this.taskRecordDTO.recordId = this.currentNode.tasks[0].recordId;
          this.taskRecordDTO.taskData = this.productionPerformanceForm;

          // id不为空更新
          if (this.productionPerformanceForm.id) {
            this.$api.businessProductionPerformance.edit(this.taskRecordDTO).then(res => {
              if (res.code === 200 && res.data) {
                this.$notify({
                  title: '成功',
                  message: '质检信息更新成功，请继续提交流程节点！',
                  type: 'success',
                  duration: 3000
                });
                if (this.currentNode.nodeCode === 'RECHECK_REPORT' || this.currentNode.nodeCode === 'FOURTH_CHECK_REPORT') {
                  this.updateProductionFileInfo();
                }
                this.productionCheckDialogVisible = false;
              }
            })
          } else { // id为空新增
            this.$api.businessProductionPerformance.add(this.taskRecordDTO).then(res => {
              if (res.code === 200 && res.data) {
                this.$notify({
                  title: '成功',
                  message: '质检信息保存成功，请继续提交流程节点！',
                  type: 'success',
                  duration: 3000
                });
                if (this.currentNode.nodeCode === 'RECHECK_REPORT' || this.currentNode.nodeCode === 'FOURTH_CHECK_REPORT') {
                  this.updateProductionFileInfo();
                }
                this.productionCheckDialogVisible = false;
              }
            })
          }
        } else {
          this.$notify({
            title: '错误',
            message: '错误个数大于0时必须填写扣分原因',
            type: 'error',
            duration: 3000
          });
        }
      } else {
        this.taskRecordDTO.recordId = this.currentNode.tasks[0].recordId;
        this.taskRecordDTO.taskData = this.productionPerformanceForm;

        // id不为空更新
        if (this.productionPerformanceForm.id) {
          this.$api.businessProductionPerformance.edit(this.taskRecordDTO).then(res => {
            if (res.code === 200 && res.data) {
              this.$notify({
                title: '成功',
                message: '质检信息更新成功，请继续提交流程节点！',
                type: 'success',
                duration: 3000
              });
              if (this.currentNode.nodeCode === 'RECHECK_REPORT' || this.currentNode.nodeCode === 'FOURTH_CHECK_REPORT') {
                this.updateProductionFileInfo();
              }
              this.productionCheckDialogVisible = false;
            }
          })
        } else { // id为空新增
          this.$api.businessProductionPerformance.add(this.taskRecordDTO).then(res => {
            if (res.code === 200 && res.data) {
              this.$notify({
                title: '成功',
                message: '质检信息保存成功，请继续提交流程节点！',
                type: 'success',
                duration: 3000
              });
              if (this.currentNode.nodeCode === 'RECHECK_REPORT' || this.currentNode.nodeCode === 'FOURTH_CHECK_REPORT') {
                this.updateProductionFileInfo();
              }
              this.productionCheckDialogVisible = false;
            }
          })
        }
      }
    },
    // 根据资产产品id更新文件路由信息
    updateProductionFileInfo() {
      this.assetsProductionForm.filePath = JSON.stringify(this.assetsProductionForm.filePath);
      this.$api.assets.updateProductionFileInfo(this.assetsProductionForm).then(res => {
        if (res.code === 200 && res.data) {
          this.$notify({
            title: '成功',
            message: '产品附件保存成功',
            type: 'success',
            duration: 3000
          });
        }
      })
    },
    // 打开产品出入库弹窗
    openWareHouseDialog(row) {
      this.warehouseDialog = true;
      this.wareHouseProductionType = row.productionType;
      this.wareHouseproductionId = row.id
    },
    handleScanEntry(scanData) {
      this.scanEntryData = scanData;
    },
    cleanWareHouseProductionType() {
      this.wareHouseProductionType = null;
      this.wareHouseproductionId = null;
    },
    // 产品出入库
    doWareHouse() {
      let productionNo = this.scanEntryData
      let wareHoaseDto = new Object();
      if (productionNo) {
        wareHoaseDto.productionNo = reportNo;
      } else {
        wareHoaseDto.productionNo = this.$refs.scanEntry.scanEntryData;
      }
      if (this.currentNode.nodeName.includes("入库")) {
        wareHoaseDto.repertoryState = 0;
      } else {
        wareHoaseDto.repertoryState = 1;
      }
      wareHoaseDto.productionType = this.wareHouseProductionType;
      wareHoaseDto.productionId = this.wareHouseproductionId;
      this.taskRecordDTO.recordId = this.currentNode.tasks[0].recordId;
      this.taskRecordDTO.taskData = wareHoaseDto;
      this.$api.assets.assetsProRepertory(this.taskRecordDTO).then(res => {
        if (res.code === 200 && res.data) {
          this.$notify({
            title: '成功',
            message: '库存操作成功，请继续提交流程节点！',
            type: 'success',
            duration: 2000
          });
          this.warehouseDialog = false;
          this.getProductionList();
        }
        else {
          this.$message({
            type: 'info',
            message: '取消操作'
          });
        }
      })
    },
    // 判断流程是否进行四审
    flowDoFourthCheck() {
      if (this.currentNode.nodeCode == 'RECHECK_REPORT') {
        // 判断评估值是否超过8000万
        let isSubstantialAssets = this.assetsEvaluationTarget.reduce((sum, obj) => { return sum + obj.estimatedValue; }, 0) > 8000;
        // 获取是否有评估目的为搬迁、司法涉讼的评估对象
        let isLawsuit = this.assetsEvaluationTarget.some(obj => obj.purposeName === '搬迁' || obj.purposeName === '资产涉讼');
        // 获取是否证券项目
        let isSecurity = this.assetsForm.security;
        // 是否证券项目,或是否评估目的搬迁、诉讼,或是否价值大于8000万
        if (isSecurity || isLawsuit || isSubstantialAssets) {
          this.nodeBusinessInfo.doFourthCheck = true;
        }
      }
    },
    // 根据产品号获取产品实收款
    getProductionRealAmount(productionNo) {
      this.$api.assets.getProductionRealAmount(productionNo).then(res => {
        if (res.code === 200 && res.data !== null) {
          this.nodeBusinessInfo.ifProductionFund = true;
        } else {
          this.nodeBusinessInfo.ifProductionFund = false;
        }
      })
    },
    // 打开绩效比例分配弹窗
    openAssetsAchievementRatioDialog() {
      // this.businessPerformanceDistributionForm.distributionList = [];
      //获取报告附件信息
      let assetsProductionDetailDTO = new Object();
      assetsProductionDetailDTO.businessId = this.pageParams.row.assetsId;
      assetsProductionDetailDTO.productionNo = this.pageParams.row.reportNo;
      this.$api.assets.getAssetsProductionDetailByNo(assetsProductionDetailDTO).then(res => {
        if (res.code == 200 && res.data !== null) {
          this.assetsProductionForm = res.data;
          this.assetsProductionForm.filePath = JSON.parse(res.data.filePath);
          this.fileList = this.assetsProductionForm.filePath;
        }
      })

      this.assetsAchievementRatioDialogVisible = true;
      // this.getPerformanceDistributionList();

      // if (this.businessPerformanceDistributionForm.distributionList !== null && this.businessPerformanceDistributionForm.distributionList[0].id !== null) {
      //   this.showDistributionButton = false;
      // } else {
      //   this.showDistributionButton = true;
      // }

    },
    // 新增资产绩效分配信息
    saveBusinessPerformanceDistribution() {
      const sum = this.businessPerformanceDistributionForm.distributionList.reduce((accumulator, obj) => {
        return accumulator + obj.performanceDistribution;
      }, 0);
      if (sum === 100) {
        this.taskRecordDTO.recordId = this.currentNode.tasks[0].recordId;
        this.taskRecordDTO.taskData = this.businessPerformanceDistributionForm;
        this.$api.businessPerformanceDistribution.addAssetsPerformanceDistribution(this.taskRecordDTO).then(res => {
          if (res.code === 200) {
            this.$notify({
              title: '成功',
              message: '绩效分配新增完成，请继续提交流程节点！',
              type: 'success',
              duration: 3000
            });
            if (this.currentNode.nodeCode === 'CHECK_ARCHIVING') {
              this.updateProductionFileInfo();
            }
            this.resetBusinessPerformanceDistributionForm();
          }
        })
      } else {
        this.$notify({
          title: '警告',
          message: '所有人员分配的绩效之和必须等于100%！',
          type: 'error',
          duration: 3000
        });
      }
    },
    // 重置绩效分配表单
    resetBusinessPerformanceDistributionForm() {
      this.assetsAchievementRatioDialogVisible = false;
      this.businessPerformanceDistributionForm.businessId = null;
      this.businessPerformanceDistributionForm.businessType = null;
      this.businessPerformanceDistributionForm.reportNo = null;
    },
    // 获取资产绩效分配信息list
    getPerformanceDistributionList() {
      this.businessPerformanceDistributionForm.businessId = this.pageParams.row.assetsId;
      this.businessPerformanceDistributionForm.businessType = 'ASSET_BUSINESS';
      this.businessPerformanceDistributionForm.reportNo = this.pageParams.row.reportNo;
      let selectDTO = this.businessPerformanceDistributionForm;
      selectDTO.distributionList = null;
      this.$api.businessPerformanceDistribution.getPerformanceDistributionList(this.businessPerformanceDistributionForm).then(res => {
        if (res.code === 200 && res.data !== null && res.data.length > 0) {
          this.businessPerformanceDistributionForm.distributionList = res.data;
          this.getAssetsBusinessMembers();
          this.showDistributionButton = false;
        } else {
          this.showDistributionButton = true;
          this.getAssetsBusinessMembers(true);
        }
      })
    },
    // 获取项目参与人信息
    getAssetsBusinessMembers(state) {
      let assetsBusinessMembersDTO = { businessId: null, reportNo: null };
      assetsBusinessMembersDTO.businessId = this.pageParams.row.assetsId;
      assetsBusinessMembersDTO.reportNo = this.pageParams.row.reportNo;
      this.$api.assets.getAssetsBusinessMembers(assetsBusinessMembersDTO).then(res => {
        // 返回不为空，且没有绩效分配信息
        if (res.code === 200 && res.data !== null) {
          this.assetsBusinessMembers = res.data;
          if (state) {
            this.businessPerformanceDistributionForm.distributionList = [];
            for (let i = 0; i < this.assetsBusinessMembers.length; i++) {
              let memberInfo = { memberId: this.assetsBusinessMembers[i].memberId, performanceDistribution: 0, memberType: this.assetsBusinessMembers[i].memberType }
              this.businessPerformanceDistributionForm.distributionList.push(memberInfo)
            }
          }
        }
      })
    },
    // 修改资产绩效分配信息
    updateAssetsPerformanceDistribution() {
      const sum = this.businessPerformanceDistributionForm.distributionList.reduce((accumulator, obj) => {
        return accumulator + obj.performanceDistribution;
      }, 0);
      if (sum === 100) {
        this.taskRecordDTO.recordId = this.currentNode.tasks[0].recordId;
        this.taskRecordDTO.taskData = this.businessPerformanceDistributionForm;
        this.$api.businessPerformanceDistribution.updateAssetsPerformanceDistribution(this.taskRecordDTO).then(res => {
          if (res.code === 200) {
            this.$notify({
              title: '成功',
              message: '绩效分配修改完成，请继续提交流程节点！',
              type: 'success',
              duration: 3000
            });
            if (this.currentNode.nodeCode === 'CHECK_ARCHIVING') {
              this.updateProductionFileInfo();
            }
            this.resetBusinessPerformanceDistributionForm();
          }
        })
      } else {
        this.$notify({
          title: '警告',
          message: '所有人员分配的绩效之和必须等于100%！',
          type: 'error',
          duration: 3000
        });
      }
    },
    // 获取联系信息
    getContactInfo() {
      if (this.assetsForm.clienteleContactId) {
        this.$api.customerLinkman.detail(this.assetsForm.clienteleContactId).then(res => {
          if (res.code === 200) {
            this.linkmanInfo = res.data;
          }
        })
      }
      if (this.assetsForm.terminalClienteleContactId) {
        this.$api.customerLinkman.detail(this.assetsForm.terminalClienteleContactId).then(res => {
          if (res.code === 200) {
            this.tLinkmanInfo = res.data; mobile
            this.assetsForm.tmobile = this.tLinkmanInfo.mobile;
          }
        })
      }
      if (this.assetsForm.terminalClienteleId) {
        this.$api.customerCompany.detail(this.assetsForm.terminalClienteleId).then(res => {
          if (res.code === 200) {
            this.tCustomerInfo = res.data;
            this.assetsForm.tmobile = this.tCustomerInfo.phone;
          }
        })
      }
    },
    // 更新资产订单基本信息
    updateOrderBaseInfo() {
      this.$confirm('是否确定要修改订单基本信息?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        if (this.assetsForm.members) {
          this.assetsForm.members = JSON.stringify(this.assetsForm.members);
        }
        this.$api.assets.updateOrderBaseInfo(this.assetsForm).then(res => {
          if (res.code === 200 && res.data) {
            this.$notify({
              title: '成功',
              message: '订单基本信息更新成功！',
              type: 'success',
              duration: 3000
            });
            this.getAssetsDetailById(this.pageParams.row.assetsId);
          } else {
            this.$notify({
              title: '失败',
              message: '订单基本信息更新失败！请稍后重试！',
              type: 'warning',
              duration: 3000
            });
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消更新'
        });
      });
    }
  }

}
</script>

<style lang="scss" scoped>
.row-style {
  margin-left: 40px;
  margin-right: 1%;
}

.major-radio {
  width: 92px
}

.task-class {
  /deep/ .el-form-item__label {
    color: red;
  }
}

.evaluate-table {
  margin-left: 40px;
  margin-top: 35px;
}

.pane-class {
  height: 800px;
  width: 100%;
  overflow-y: scroll;
}

/deep/ .cell-class {
  font-size: 13px;
  color: black;
}

.table {
  /deep/ thead {
    .el-table-column--selection {
      .cell {
        display: none;
      }
    }
  }
}

/deep/.doWarehouseClass {
  border-radius: 10px;
}

.button-area {
  position: absolute;
  top: 20px;
  right: 50px;
}

.error-type {
  margin-right: 5px;
}

.error-type:hover {
  cursor: pointer;
}

.box-card {
  margin-top: 40px
}

.time {
  font-size: 13px;
  color: #999;
  float: right;
  margin-top: 5px;
}

.bottom {
  margin-top: 13px;
  line-height: 12px;
}

.button {
  float: left;
}

.image {
  width: 100%;
  padding: 0%;
  display: block;
}

.control {
  z-index: 999;
  position: relative;
  top: 10px;
}
</style>