<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
  <div>
    <div v-if="showDownload">
      <el-row type="flex" justify="end">
        <el-button @click="downloadProofreadAuditTpl">下载</el-button>
      </el-row>
      <el-divider content-position="left"><i class="el-icon-document"></i> 校对</el-divider>
    </div>
      <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="true"
               label-width="120px" @submit.native.prevent>

        <el-row :gutter="15">
          <el-col :span="24">
            <el-form-item label="项目名称" prop="projectName">
              <el-input :disabled="true" v-model="inputForm.projectName"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="评估基准日" prop="assessmentDate">
              <el-input :disabled="true" v-model="inputForm.assessmentDate"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="项目负责人" prop="projectManagerName">
              <el-input :disabled="true" v-model="inputForm.projectManagerName"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="项目审核人" prop="processUserName">
              <el-input :disabled="true" v-model="inputForm.processUserName"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="审核日期" prop="processDate">
              <el-date-picker
                placement="bottom-start"
                v-model="inputForm.processDate"
                type="date"
                :disabled="true"
                style="width: 100%"
                placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-divider content-position="left"><i class="el-icon-document"></i>明细表</el-divider>
        <el-row :gutter="15" >
          <vxe-table
            border
            show-overflow
            ref="detailFor1010"
            class="vxe-table-element"
            :data="inputForm.detailFor1010"
            style="margin-left: 5em"
            @cell-click=""
            @edit-closed=""
            highlight-current-row
            :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
          >
            <vxe-table-column field="typeName" title="审核要点" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input :disabled="true" v-model="scope.row.typeName" ></el-input>
              </template>
            </vxe-table-column>
<!--            <vxe-table-column width="150px" field="reviewComments" title="审核意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.reviewComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
<!--            <vxe-table-column width="150px" field="replyComments" title="回复意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.replyComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
            <vxe-table-column width="150px" field="reviewComments" title="审核意见（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.reviewComments" transfer>
                  <vxe-option
                          v-for="item in $dictUtils.getDictList('yes_no_flag')"
                          :key="item.value"
                          :value="item.label"
                          :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="150px" field="isApply" title="是否适用（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.isApply" transfer>
                  <vxe-option
                    v-for="item in $dictUtils.getDictList('yes_no_flag')"
                    :key="item.value"
                    :value="item.label"
                    :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="350px" field="replyComments" title="回复意见" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input v-model="scope.row.replyComments" ></el-input>
              </template>
            </vxe-table-column>
          </vxe-table>
        </el-row>

        <el-divider content-position="left"><i class="el-icon-document"></i>评估说明</el-divider>
        <el-row></el-row>
        <el-divider content-position="left">封面至评估范围</el-divider>
        <el-row :gutter="15">
          <vxe-table
            border
            show-overflow
            ref="details"
            class="vxe-table-element"
            :data="inputForm.detailFor2010"
            style="margin-left: 5em"
            @cell-click=""
            @edit-closed=""
            highlight-current-row
            :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
          >
            <vxe-table-column field="typeName" title="审核要点" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input :disabled="true" v-model="scope.row.typeName" ></el-input>
              </template>
            </vxe-table-column>
<!--            <vxe-table-column width="150px" field="reviewComments" title="审核意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.reviewComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
<!--            <vxe-table-column width="150px" field="replyComments" title="回复意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.replyComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
            <vxe-table-column width="150px" field="reviewComments" title="审核意见（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.reviewComments" transfer>
                  <vxe-option
                          v-for="item in $dictUtils.getDictList('yes_no_flag')"
                          :key="item.value"
                          :value="item.label"
                          :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="150px" field="isApply" title="是否适用（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.isApply" transfer>
                  <vxe-option
                    v-for="item in $dictUtils.getDictList('yes_no_flag')"
                    :key="item.value"
                    :value="item.label"
                    :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="350px" field="replyComments" title="回复意见" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input v-model="scope.row.replyComments" ></el-input>
              </template>
            </vxe-table-column>
          </vxe-table>
        </el-row>

        <el-divider content-position="left">资产核实情况总体说明</el-divider>
        <el-row :gutter="15">
          <vxe-table
            border
            show-overflow
            ref="details"
            class="vxe-table-element"
            :data="inputForm.detailFor2020"
            style="margin-left: 5em"
            @cell-click=""
            @edit-closed=""
            highlight-current-row
            :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
          >
            <vxe-table-column field="typeName" title="审核要点" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input :disabled="true" v-model="scope.row.typeName" ></el-input>
              </template>
            </vxe-table-column>
<!--            <vxe-table-column width="150px" field="reviewComments" title="审核意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.reviewComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
<!--            <vxe-table-column width="150px" field="replyComments" title="回复意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.replyComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
            <vxe-table-column width="150px" field="reviewComments" title="审核意见（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.reviewComments" transfer>
                  <vxe-option
                          v-for="item in $dictUtils.getDictList('yes_no_flag')"
                          :key="item.value"
                          :value="item.label"
                          :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="150px" field="isApply" title="是否适用（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.isApply" transfer>
                  <vxe-option
                    v-for="item in $dictUtils.getDictList('yes_no_flag')"
                    :key="item.value"
                    :value="item.label"
                    :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="350px" field="replyComments" title="回复意见" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input v-model="scope.row.replyComments" ></el-input>
              </template>
            </vxe-table-column>
          </vxe-table>
        </el-row>

        <el-divider content-position="left">资产基础法/成本法评估技术说明</el-divider>
        <el-row :gutter="15">
          <vxe-table
            border
            show-overflow
            ref="details"
            class="vxe-table-element"
            :data="inputForm.detailFor2030"
            style="margin-left: 5em"
            @cell-click=""
            @edit-closed=""
            highlight-current-row
            :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
          >
            <vxe-table-column field="typeName" title="审核要点" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input :disabled="true" v-model="scope.row.typeName" ></el-input>
              </template>
            </vxe-table-column>
<!--            <vxe-table-column width="150px" field="reviewComments" title="审核意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.reviewComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
<!--            <vxe-table-column width="150px" field="replyComments" title="回复意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.replyComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
            <vxe-table-column width="150px" field="reviewComments" title="审核意见（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.reviewComments" transfer>
                  <vxe-option
                          v-for="item in $dictUtils.getDictList('yes_no_flag')"
                          :key="item.value"
                          :value="item.label"
                          :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="150px" field="isApply" title="是否适用（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.isApply" transfer>
                  <vxe-option
                    v-for="item in $dictUtils.getDictList('yes_no_flag')"
                    :key="item.value"
                    :value="item.label"
                    :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="350px" field="replyComments" title="回复意见" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input v-model="scope.row.replyComments" ></el-input>
              </template>
            </vxe-table-column>
          </vxe-table>
        </el-row>

        <el-divider content-position="left">评估结论及分析</el-divider>
        <el-row :gutter="15">
          <vxe-table
            border
            show-overflow
            ref="details"
            class="vxe-table-element"
            :data="inputForm.detailFor2040"
            style="margin-left: 5em"
            @cell-click=""
            @edit-closed=""
            highlight-current-row
            :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
          >
            <vxe-table-column field="typeName" title="审核要点" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input :disabled="true" v-model="scope.row.typeName" ></el-input>
              </template>
            </vxe-table-column>
<!--            <vxe-table-column width="150px" field="reviewComments" title="审核意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.reviewComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
<!--            <vxe-table-column width="150px" field="replyComments" title="回复意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.replyComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
            <vxe-table-column width="150px" field="reviewComments" title="审核意见（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.reviewComments" transfer>
                  <vxe-option
                          v-for="item in $dictUtils.getDictList('yes_no_flag')"
                          :key="item.value"
                          :value="item.label"
                          :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="150px" field="isApply" title="是否适用（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.isApply" transfer>
                  <vxe-option
                    v-for="item in $dictUtils.getDictList('yes_no_flag')"
                    :key="item.value"
                    :value="item.label"
                    :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="350px" field="replyComments" title="回复意见" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input v-model="scope.row.replyComments" ></el-input>
              </template>
            </vxe-table-column>
          </vxe-table>
        </el-row>

        <el-divider content-position="left">关于评估有关事项的说明</el-divider>
        <el-row :gutter="15">
          <vxe-table
            border
            show-overflow
            ref="details"
            class="vxe-table-element"
            :data="inputForm.detailFor2050"
            style="margin-left: 5em"
            @cell-click=""
            @edit-closed=""
            highlight-current-row
            :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
          >
            <vxe-table-column field="typeName" title="审核要点" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input :disabled="true" v-model="scope.row.typeName" ></el-input>
              </template>
            </vxe-table-column>
<!--            <vxe-table-column width="150px" field="reviewComments" title="审核意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.reviewComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
<!--            <vxe-table-column width="150px" field="replyComments" title="回复意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.replyComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
            <vxe-table-column width="150px" field="reviewComments" title="审核意见（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.reviewComments" transfer>
                  <vxe-option
                          v-for="item in $dictUtils.getDictList('yes_no_flag')"
                          :key="item.value"
                          :value="item.label"
                          :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="150px" field="isApply" title="是否适用（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.isApply" transfer>
                  <vxe-option
                    v-for="item in $dictUtils.getDictList('yes_no_flag')"
                    :key="item.value"
                    :value="item.label"
                    :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="350px" field="replyComments" title="回复意见" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input v-model="scope.row.replyComments" ></el-input>
              </template>
            </vxe-table-column>
          </vxe-table>
        </el-row>

        <el-divider content-position="left">其他问题</el-divider>
        <el-row :gutter="15">
          <vxe-table
            border
            show-overflow
            ref="details"
            class="vxe-table-element"
            :data="inputForm.detailFor2060"
            style="margin-left: 5em"
            @cell-click=""
            @edit-closed=""
            highlight-current-row
            :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
          >
            <vxe-table-column field="typeName" title="审核要点" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input :disabled="true" v-model="scope.row.typeName" ></el-input>
              </template>
            </vxe-table-column>
<!--            <vxe-table-column width="150px" field="reviewComments" title="审核意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.reviewComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
<!--            <vxe-table-column width="150px" field="replyComments" title="回复意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.replyComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
            <vxe-table-column width="150px" field="reviewComments" title="审核意见（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.reviewComments" transfer>
                  <vxe-option
                          v-for="item in $dictUtils.getDictList('yes_no_flag')"
                          :key="item.value"
                          :value="item.label"
                          :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="150px" field="isApply" title="是否适用（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.isApply" transfer>
                  <vxe-option
                    v-for="item in $dictUtils.getDictList('yes_no_flag')"
                    :key="item.value"
                    :value="item.label"
                    :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="350px" field="replyComments" title="回复意见" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input v-model="scope.row.replyComments" ></el-input>
              </template>
            </vxe-table-column>
          </vxe-table>
        </el-row>

        <el-divider content-position="left"><i class="el-icon-document"></i>评估报告</el-divider>
        <el-row :gutter="15">
          <vxe-table
            border
            show-overflow
            ref="details"
            class="vxe-table-element"
            :data="inputForm.detailFor30"
            style="margin-left: 5em"
            @cell-click=""
            @edit-closed=""
            highlight-current-row
            :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
          >
            <vxe-table-column field="typeName" title="审核要点" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input :disabled="true" v-model="scope.row.typeName" ></el-input>
              </template>
            </vxe-table-column>
<!--            <vxe-table-column width="150px" field="reviewComments" title="审核意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.reviewComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
<!--            <vxe-table-column width="150px" field="replyComments" title="回复意见" :edit-render="{}">-->
<!--              <template v-slot:edit="scope">-->
<!--                <el-input v-model="scope.row.replyComments" ></el-input>-->
<!--              </template>-->
<!--            </vxe-table-column>-->
            <vxe-table-column width="150px" field="reviewComments" title="审核意见（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.reviewComments" transfer>
                  <vxe-option
                          v-for="item in $dictUtils.getDictList('yes_no_flag')"
                          :key="item.value"
                          :value="item.label"
                          :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="150px" field="isApply" title="是否适用（√/×）" :edit-render="{}">
              <template v-slot:edit="scope">
                <vxe-select v-model="scope.row.isApply" transfer>
                  <vxe-option
                    v-for="item in $dictUtils.getDictList('yes_no_flag')"
                    :key="item.value"
                    :value="item.label"
                    :label="item.label">
                  </vxe-option>
                </vxe-select>
              </template>
            </vxe-table-column>
            <vxe-table-column width="350px" field="replyComments" title="回复意见" :edit-render="{}">
              <template v-slot:edit="scope">
                <el-input v-model="scope.row.replyComments" ></el-input>
              </template>
            </vxe-table-column>
          </vxe-table>
        </el-row>

        <el-divider content-position="left"><i class="el-icon-document"></i>保留意见</el-divider>
        <el-input v-model="inputForm.reservations"
                  type="textarea"
                  :rows="5"
                  maxlength="2000"
                  placeholder="请输入保留意见"
                  show-word-limit>
        </el-input>

        <el-divider content-position="left"><i class="el-icon-document"></i>未修改意见</el-divider>
        <el-input v-model="inputForm.unmodifiedComments"
                  type="textarea"
                  :rows="5"
                  maxlength="2000"
                  placeholder="请输入未修改意见"
                  show-word-limit>
        </el-input>

      </el-form>

<!--      <span slot="footer" class="dialog-footer">-->
<!--        <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>-->
<!--        <el-button size="small" type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>-->
<!--      </span>-->

  </div>
</template>

<script>
  import ProofreadInfoService from '@/api/sys/ProofreadInfoService'
  import ProofreadTypeService from '@/api/sys/ProofreadTypeService'
  import ProgramProjectListInfoService from '@/api/program/ProgramProjectListInfoService'
  import UserService from '@/api/sys/UserService'
  export default {
    data () {
      return {
        title: '',
        method: '',
        visible: false,
        loading: false,
        inputForm: {
          projectId: '',
          projectName: '',
          assessmentDate: '',
          projectManagerName: '',
          processUserId: '',
          processUserName: '',
          processDate: '',
          reservations: '',
          unmodifiedComments: '',
          details: [],
          detailFor1010: [],
          detailFor2010: [],
          detailFor2020: [],
          detailFor2030: [],
          detailFor2040: [],
          detailFor2050: [],
          detailFor2060: [],
          detailFor30: []
        },
        showDownload: false
      }
    },
    proofreadInfoService: null,
    proofreadTypeService: null,
    programProjectListInfoService: null,
    UserService: null,
    created () {
      this.proofreadInfoService = new ProofreadInfoService()
      this.programProjectListInfoService = new ProgramProjectListInfoService()
      this.userService = new UserService()
      this.proofreadTypeService = new ProofreadTypeService()
    },
    components: {
    },
    computed: {
      name () {
        return JSON.parse(localStorage.getItem('user')).name
      },
      userId () {
        return JSON.parse(localStorage.getItem('user')).id
      }
    },
    methods: {
      init (id) {
        this.showDownload = false
        this.inputForm = {
          projectId: '',
          projectName: '',
          assessmentDate: '',
          projectManagerName: '',
          processUserId: '',
          processUserName: '',
          processDate: '',
          reservations: '',
          unmodifiedComments: '',
          details: [],
          detailFor1010: [],
          detailFor2010: [],
          detailFor2020: [],
          detailFor2030: [],
          detailFor2040: [],
          detailFor2050: [],
          detailFor2060: [],
          detailFor30: []
        }
        this.visible = true
        this.loading = false
        this.$nextTick(() => {
          this.loading = true
          this.proofreadInfoService.findById(id, '1').then(({data}) => {
            if (this.commonJS.isNotEmpty(data)) {
              this.showDownload = true
            }
            if (!this.commonJS.isEmpty(data.projectId)) {
              this.$refs.inputForm.resetFields()
              this.inputForm = this.recover(this.inputForm, data)
              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
              this.inputForm.processDate = data.processDate
              this.detailDivide(data.details)
            } else {
              // 初始化
              this.programProjectListInfoService.queryById(id).then(({data}) => {
                this.inputForm.projectId = data.id
                this.inputForm.projectName = data.name
                this.inputForm.assessmentDate = data.assessmentDate
                this.userService.queryById(data.projectManager).then(({data}) => {
                  this.inputForm.projectManagerName = data.name
                })
              })
              this.inputForm.processUserId = this.userId
              this.inputForm.processUserName = this.name
              this.inputForm.processDate = new Date()
              this.proofreadInfoService.list('1').then(({data}) => { this.detailDivide(data) })
            }
            this.loading = false
          })
        })
      },
      // 表单提交
      doSubmit () {
        this.$refs['inputForm'].validate((valid) => {
          if (valid) {
            this.loading = true
            // 列表处理
            this.inputForm.details = []
            this.inputForm.detailFor1010.forEach(item => { this.inputForm.details.push(item) })
            this.inputForm.detailFor2010.forEach(item => { this.inputForm.details.push(item) })
            this.inputForm.detailFor2020.forEach(item => { this.inputForm.details.push(item) })
            this.inputForm.detailFor2030.forEach(item => { this.inputForm.details.push(item) })
            this.inputForm.detailFor2040.forEach(item => { this.inputForm.details.push(item) })
            this.inputForm.detailFor2050.forEach(item => { this.inputForm.details.push(item) })
            this.inputForm.detailFor2060.forEach(item => { this.inputForm.details.push(item) })
            this.inputForm.detailFor30.forEach(item => { this.inputForm.details.push(item) })
            this.inputForm.type = '1'
            this.proofreadInfoService.save(this.inputForm).then(({data}) => {
              this.close()
              this.$message.success(data)
              this.loading = false
            }).catch(() => {
              this.loading = false
            })
          }
        })
      },
      close () {
        this.$refs.inputForm.resetFields()
        this.visible = false
      },
      detailDivide (details) {
        this.inputForm.detailFor1010 = []
        this.inputForm.detailFor2010 = []
        this.inputForm.detailFor2020 = []
        this.inputForm.detailFor2030 = []
        this.inputForm.detailFor2040 = []
        this.inputForm.detailFor2050 = []
        this.inputForm.detailFor2060 = []
        this.inputForm.detailFor30 = []
        details.forEach(item => {
          if (item.sort.startsWith('1010')) {
            this.inputForm.detailFor1010.push(item)
          }
          if (item.sort.startsWith('2010')) {
            this.inputForm.detailFor2010.push(item)
          }
          if (item.sort.startsWith('2020')) {
            this.inputForm.detailFor2020.push(item)
          }
          if (item.sort.startsWith('2030')) {
            this.inputForm.detailFor2030.push(item)
          }
          if (item.sort.startsWith('2040')) {
            this.inputForm.detailFor2040.push(item)
          }
          if (item.sort.startsWith('2050')) {
            this.inputForm.detailFor2050.push(item)
          }
          if (item.sort.startsWith('2060')) {
            this.inputForm.detailFor2060.push(item)
          }
          if (item.sort.startsWith('30')) {
            this.inputForm.detailFor30.push(item)
          }
        })
      },
      // 下载资产评估项目（校对）审核记录表
      downloadProofreadAuditTpl () {
        // this.$utils.downloadExcel('/sys/project/import/template')
        this.loading = true
        this.programProjectListInfoService.downloadProofreadAuditTpl(this.inputForm.projectId).then((res) => {
          // 将二进制流文件写入excel表，以下为重要步骤
          this.$utils.downloadExcel(res.data, '资产评估项目（校对）审核记录表.xls')
          this.loading = false
        }).catch(function (err) {
          this.loading = false
          if (err.response) {
            console.log(err.response)
          }
        })
      }
    }
  }
</script>
<style scoped>
  /deep/ .el-input-number .el-input__inner {
    text-align: left;
  }
  .el-divider__text {
    font-size: 16px;
    font-weight: bold;
  }
</style>
