<!--
   *@description: 工程历史详情
   *@author: yh Fu
   *@date: 2024-1-8 10:04:23
   *@version: V1.0.5
-->

<template>
  <div style="width: 100%;height: 100%;">
    <el-dialog
    :visible.sync="dialogVisible"
    :title="titleName"
    width="60%"
    append-to-body
    custom-class="ConstructionDetailsDialog">
    <el-tabs type="card" v-model="activeNames" @tab-click="viewSource" class="projectTabs">
      <el-tab-pane
        :label="e.label"
        :name="e.value"
        v-for="(e,idx) in currentDicts"
        :key="idx"
      >
        <el-checkbox-group v-model="checkList" >
        <el-collapse
          class="rmOldPie"
          v-for="(e,idx) in currentCollapses"
          :key="idx"
        >
          <el-collapse-item :name="idx">
            <template slot="title">
              <div style="display: flex;width: 100%;height: 100%;">
<!--                <div-->
<!--                  style="width: 15px;height: 15px;margin: auto 10px;border-radius: 73%;background-color: #a3d3ff;box-shadow: 1px 1px rgb(131 131 131 / 62%);">-->
<!--                </div>-->
                <el-checkbox :label="e.id" @change="handleCheckedCitiesChange">
                  <h2 style="margin-left: 1%;font-weight: 700;">{{ e.updateTime }}</h2>
                </el-checkbox>
                <h2 :style="'margin-left: 20%;font-weight: 700;'+ (e.state == '1'? 'color: #1ab394':'') ">  {{e.state=='0'?"该施工信息审核未通过":e.state=='1'?"该施工信息审核通过":""}}</h2>
              </div>
            </template>
            <div class="personInfo">
<!--              <span>负责人：{{ e.headName }} </span>-->
<!--              <span>负责人电话：{{-->
<!--                  e.headPhone === undefined || e.headPhone === null || e.headPhone === '' ? '无' : e.headPhone-->
<!--                }}</span>-->
              <span>施工人：{{ userNames[idx].nickName }}</span>
              <span>施工人电话：{{ userNames[idx].phonenumber }}</span>
            </div>
            <hr>
            <!--带气封堵施工 start-->
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='pe' || engineType==='iron_air' || enginClassification == 'pressure_regulating'">
              <el-form :model="nodeInfo" class="nodeForm materialForm">
                <el-row style="width: 100%;"
                        v-show="enginClassification != 'pressure_regulating'"
                >
                  <el-col :span="17">
                    <el-form-item
                        :class="'labelWidth'"
                        label="工程名称"
                        label-width="95px"
                    >
                      <div class="block" style="display: inline-block; margin-right: 20px;">
                        <!--{{ kind }}-->
                        <!--<h4 style="width: 995px;font-weight: 600;text-align: left;text-indent: 25px;">工程名称：{{ kind }}</h4>-->
                        <!--<h4 style="width: 995px;font-weight: 600;text-align: left;text-indent: 25px;">工程名称：{{ kind }}</h4>-->
                        <el-input v-model="kind" placeholder="请输入工程名称" style="width: 100%" :disabled="true"> </el-input>
                      </div>
                    </el-form-item>
                    </el-col>
                </el-row>
                <el-row style="width: 100%;"
                        v-show="enginClassification != 'pressure_regulating'"
                >
                  <el-col :span="17">
                    <el-form-item
                        :class="'labelWidth'"
                        label="工程地点"
                        label-width="95px"
                    >
                      <div class="block" style="display: inline-block; margin-right: 20px;">
                        <el-input v-model="e.constructAddre" placeholder="请输入工程地点" style="width: 100%" :disabled="status == 'read-only'"> </el-input>
                      </div>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-form-item
                    style="width: 100%;"
                    v-show="enginClassification != 'pressure_regulating'"
                    :class="'labelWidth'"
                    label="作业方式"
                    label-width="95px"
                >
                  <div class="block" style="display: inline-block; margin-right: 20px;">
                    <el-input v-model="e.segmentedCompressionQualified" placeholder="请输入作业方式" style="width: 100%" :disabled="status == 'read-only'"> </el-input>
                  </div>
                </el-form-item>
                <el-form-item
                  v-show="enginClassification != 'pressure_regulating'"
                    style="width: 100%;"
                    :class="'labelWidth'"
                    label="管道压力"
                    label-width="95px"
                >
                  <div class="block" style="display: inline-block; margin-right: 20px;">
                    <el-input v-model="e.constructAccordingDrawings" placeholder="请输入管道压力" style="width: 100%" :disabled="status == 'read-only'"> </el-input>
                  </div>
                </el-form-item>
                <el-form-item
                    :class="'labelWidth'"
                    label="施工内容"
                    label-width="95px"
                    v-if="enginClassification == 'pressure_regulating'"
                >
                  <div class="block" style="display: inline-block; margin-right: 20px;">
                    <el-input type="textarea" :rows="3" v-model="e.remark" placeholder="请输入施工内容" style="width: 100%" :disabled="status == 'read-only'"> </el-input>
                  </div>
                </el-form-item>
              </el-form>
              <!--<h4 style="width: 995px;font-weight: 600;text-align: left;text-indent: 25px;">工程名称：{{ kind }}</h4>-->
              <!--<h4 style="width: 995px;font-weight: 600;text-align: left;text-indent: 25px;">地点：{{ e.constructAddre }}</h4>-->
              <!--<h4 style="width: 995px;font-weight: 600;text-align: left;text-indent: 25px;">作业方式：{{ e.segmentedCompressionQualified }}</h4>-->
              <!--<h4 style="width: 995px;font-weight: 600;text-align: left;text-indent: 25px;">施工内容：{{ e.remark }}</h4>-->
              <!--<h4 style="width: 995px;font-weight: 600;text-align: left;text-indent: 25px;">管道压力：{{ e.constructAccordingDrawings }}</h4>-->
              <!--<el-form class="nodeForm materialForm">-->
                <!--<el-form-item-->
                    <!--:prop="e.headName + ''"-->
                    <!--:class="'labelWidth'"-->
                    <!--label="工程名称"-->
                    <!--label-width="95px"-->
                <!--&gt;-->
                  <!--<div class="block" style="display: inline-block; margin-right: 20px;">-->
                    <!--<el-input v-model="e.headName" placeholder="请输入工程名称" style="width: 100%"  oninput="value=value.match(/\d+(\.\d{0,1})?/) ? value.match(/\d+(\.\d{0,1})?/)[0] : ''"  max="999999999" :disabled="status == 'read-only'"> </el-input>-->
                  <!--</div>-->
                <!--</el-form-item>-->
              <!--</el-form>-->
            </div>
            <!--带气封堵施工 end-->
            <!--  用料明细 -->
            <div
                v-for="(i,index) in e.zEngineeringMaterialBo || [] "
                :key="index"
              >
                <el-form :model="nodeInfo" class="nodeForm materialForm">
                    <el-form-item
                      :prop="i.materialQuality"
                      :class="enginType != '基建工程' && enginType != '民用工程' ? 'labelWidth' : '' "
                      :label="activeNames == '阀管' ? '灶具管厂家': '材质'"
                      v-show="i.materialQuality != null || (enginClassification != null && !enginClassification.includes('pressure_regulating'))"
                      label-width="95px"
                      >
                      <el-select  v-model="i.materialQuality" placeholder="请选择材质" style="width: 100%" @change="getEnginSpecificationsList(i, index,idx)" :disabled="status == 'read-only' ">
                          <el-option
                          v-for="e in (activeNames == '阀管' ?materialQualityList_zjg:materialQualityList)"
                          :key="e.id"
                          :label="e.name"
                          :value="e.id"
                          ></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item
                      :prop="i.specifications"
                      :class="enginType != '基建工程' && enginType != '民用工程' ? 'labelWidth' : '' "
                      label="规格"
                      v-show="i.materialQuality != null || (enginClassification != null && !enginClassification.includes('pressure_regulating'))"
                      label-width="95px"

                      >
                      <el-select v-model="i.specifications" placeholder="请选择规格" style="width: 100%" :disabled="status == 'read-only' ">
                          <!-- <el-option
                          v-for="e in specificationsList"
                          :key="e.id"
                          :label="e.name"
                          :value="e.id"
                          ></el-option> -->
                          <el-option
                          v-for="e in corrosionLevelListAll.filter(e => e.materId == i.materialQuality)"
                          :key="e.id"
                          :label="e.name"
                          :value="e.id"
                          ></el-option>
                      </el-select>
                    </el-form-item>
                  <el-form-item
                    v-if="currentDicts.some(item=>item.label==='底腿')||(enginClassification != null && !enginClassification.includes('pressure_regulating'))"
                    :prop="i.remark + ''"
                    :class="enginType != '基建工程' && enginType != '民用工程' ? 'labelWidth' : '' "
                    label="施工内容"
                    v-show="currentDicts.some(item=>item.label==='底腿')||node==='调压柜安装'||(enginClassification != null && enginClassification.includes('pressure_regulating'))"
                    label-width="95px"
                  >
                    <div class="block" style="display: inline-block; margin-right: 20px;">
                      <el-input v-model="i.remark" placeholder="请输入施工内容" style="width: 100%"   maxlength="100" type="textarea" :disabled="status == 'read-only'"></el-input>
                    </div>
                  </el-form-item>
                  <el-form-item
                    v-if="currentDicts.some(item=>item.label==='底腿')"
                    :prop="e.constructAddre + ''"
                    :class="enginType != '基建工程' && enginType != '民用工程' ? 'labelWidth' : '' "
                    label="位置"
                    v-show="currentDicts.some(item=>item.label==='底腿')"
                    label-width="95px"
                  >
                    <div class="block" style="display: inline-block; margin-right: 20px;">
                      <el-select v-model="e.constructAddre" style="width: 100%;" :disabled="status == 'read-only'">
                        <el-option
                          v-for="e in dict.type.construct_addre"
                          :key="e.value"
                          :label="e.label"
                          :value="e.value"
                        ></el-option>
                      </el-select>
                    </div>
                  </el-form-item>

                  <el-form-item
                    v-if="currentDicts.some(item=>item.label==='底腿')"
                    :prop="i.remark + ''"
                    :class="enginType != '基建工程' && enginType != '民用工程' ? 'labelWidth' : '' "
                    label="第"
                    v-show="i.remark != null"
                    label-width="95px"
                  >
                    <div class="block" style="display: inline-block; margin-right: 20px;">
                      <el-input v-model="i.remark" placeholder="请输入具体位置" style="width: 90%;" maxlength="255" type="number" :disabled="status == 'read-only'"/><span style="font-weight:bold;">根</span>
                    </div>
                  </el-form-item>

                    <el-form-item
                      v-if="!currentDicts.some(item=>item.label==='底腿')"
                      :prop="i.number + ''"
                      :class="enginType != '基建工程' && enginType != '民用工程' ? 'labelWidth' : '' "
                      label="数量"
                      v-show="i.number != null || (enginClassification != null && !enginClassification.includes('pressure_regulating'))"
                      label-width="95px"
                      >
                      <div class="block" style="display: inline-block; margin-right: 20px;">
                        <el-input v-model="i.number" placeholder="请输入数量" style="width: 100%"  oninput="value=value.match(/\d+(\.\d{0,1})?/) ? value.match(/\d+(\.\d{0,1})?/)[0] : ''"  max="999999999" :disabled="status == 'read-only'"> </el-input>

                      </div>
                    </el-form-item>


                    <el-form-item
                      :prop="e.remark + ''"
                      :class="enginType != '基建工程' && enginType != '民用工程' ? 'labelWidth' : '' "
                      label="描述"
                      v-show="((e.remark != null||!currentDicts.some(item=>item.label==='底腿')) && (enginClassification!='pressure_regulating'))"
                      >
                      <div class="block" style="display: inline-block; margin-right: 20px;">
                        <el-input v-model="e.remark" placeholder="请输入描述" style="width: 100%"  maxlength="100" :disabled="status == 'read-only'"></el-input>
                      </div>
                    </el-form-item>

                    <el-form-item
                      :prop="i.corrosionLevel"
                      label="腐蚀等级"
                      v-show="i.corrosionLevel != null"
                      label-width="95px"

                      >
                      <!--                  :rules="{required: true, message: '请输入材质', trigger: 'blur'}"-->
                      <!--                  <el-input v-model="item.materialQuality" placeholder="请输入材质" style="width: 100%"/>-->
                      <el-select v-model="i.corrosionLevel" placeholder="请选择腐蚀等级" style="width: 100%" :disabled="status == 'read-only' ">
                          <el-option
                          v-for="e in materialQualityList"
                          :key="e.id"
                          :label="e.name"
                          :value="e.id"
                          ></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item
                      :prop="i.visitType"
                      label="上门类型"
                      v-show="i.visitType != null"
                      label-width="95px"

                      >
                      <!--                  :rules="{required: true, message: '请输入材质', trigger: 'blur'}"-->
                      <!--                  <el-input v-model="item.materialQuality" placeholder="请输入材质" style="width: 100%"/>-->
                      <el-select v-model="i.visitType" placeholder="请选择上门类型" style="width: 100%" :disabled="status == 'read-only' ">
                          <el-option
                          v-for="e in dict.type.visit_type"
                          :key="e.value"
                          :label="e.label"
                          :value="e.value"
                          ></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item
                      :prop="i.selfClosingValveType"
                      label="自闭阀类型"
                      v-show="i.selfClosingValveType != null"
                      label-width="95px"
                      >
                      <!--                  :rules="{required: true, message: '请输入材质', trigger: 'blur'}"-->
                      <!--                  <el-input v-model="item.materialQuality" placeholder="请输入材质" style="width: 100%"/>-->
                      <el-select v-model="i.selfClosingValveType" placeholder="请选择自闭阀类型" style="width: 100%" :disabled="status == 'read-only' ">
                          <el-option
                            v-for="e in materialQualityList_zbf"
                            :key="e.id"
                            :label="e.name"
                            :value="e.id"
                          ></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item
                      :prop="i.brand"
                      label="品牌"
                      v-show="i.brand != null"
                      label-width="95px"
                      >
                      <!--                  :rules="{required: true, message: '请输入材质', trigger: 'blur'}"-->
                      <!--                  <el-input v-model="item.materialQuality" placeholder="请输入材质" style="width: 100%"/>-->
                      <el-select v-model="i.brand" placeholder="请选择品牌" style="width: 100%" :disabled="status == 'read-only' ">
                          <el-option
                            v-for="e in materialQualityList"
                            :key="e.id"
                            :label="e.name"
                            :value="e.id"
                          ></el-option>
                      </el-select>
                    </el-form-item>
                </el-form>
                <!-- <el-input size="mini" v-if="i.brand" style="width: 80%" v-model="i.brand" placeholder="请输入品牌">
                  <template slot="prepend">品牌</template>
                </el-input>
                <el-input v-if="i.visitType" size="mini" v-model="i.visitType" placeholder="请输入品牌">
                  <template slot="prepend">上门类型</template>
                </el-input>
                <el-input size="mini" v-if="i.corrosionLevel" v-model="i.corrosionLevel" placeholder="请输入品牌">
                  <template slot="prepend">腐蚀等级</template>
                </el-input>
                <el-input size="mini" v-if="i.selfClosingValveType" v-model="i.selfClosingValveType"
                          placeholder="请输入品牌">
                  <template slot="prepend">自闭阀类型</template>
                </el-input> -->
            </div>
            <!-- <el-form-item label="照片" prop="zEngiineeringPhotoBoList" class="obsImage"> -->
              <div style="display: flex;width: 100%;height: 100%;" v-if="
              !(currentDicts.some(item=>item.label==='底腿'))&&
              !(node==='下沟')&&
              !(node==='iron_air')&&
              !(node==='pe')&&
              !(node=='回填')&&
              !(node=='trench_construction')&&
              !(node=='underditch_construction')
           "
              >
                <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">图片</h3>
                <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getUrl(arguments,idx)"
                  :value="e.zEngiineeringPhotoBoList"
                  :disabled="status == 'read-only' "
                ></ObsImageUpload>
              </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='trench_construction'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">焊接照片</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getwelding(arguments,idx)"
                  :value="e.welding"
                  :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='trench_construction'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">防腐照片</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getaczoiling(arguments,idx)"
                  :value="e.aczoiling"
                  :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='underditch_construction'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">管道下沟</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getpiping(arguments,idx)"
                  :value="e.piping"
                  :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='underditch_construction'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">警示铺设</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getwarning(arguments,idx)"
                  :value="e.warning"
                  :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='underditch_construction'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">回填照片</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getbackfilling(arguments,idx)"
                  :value="e.backfilling"
                  :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='pe'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">鞍型焊接</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getpeSaddleWelding(arguments,idx)"
                  :value="e.peSaddleWelding"
                  :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='pe'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">气密实验</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getpeAirtightTest(arguments,idx)"
                  :value="e.peAirtightTest"
                  :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='pe'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">开孔</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getpeHolesOpening(arguments,idx)"
                  :value="e.peHolesOpening"
                  :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='pe'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">清扫</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getpeCleaning(arguments,idx)"
                  :value="e.peCleaning"
                  :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='pe'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">封堵</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getpePlugging(arguments,idx)"
                  :value="e.pePlugging"
                  :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='pe'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">碰口作业</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getpeCollisionOperating(arguments,idx)"
                  :value="e.peCollisionOperating"
                  :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='pe'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">通气捡漏</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getpeAirrecovering(arguments,idx)"
                  :value="e.peAirrecovering"
                  :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='pe'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">作业完成</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getpeHomeworkDone(arguments,idx)"
                  :value="e.peHomeworkDone"
                  :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='iron_air'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">管道壁厚</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getironPipelineThickness(arguments,idx)"
                  :value="e.ironPipelineThickness"
                  :disabled="status == 'read-only'"
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='iron_air'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">焊接四通</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getiron4Welding(arguments,idx)"
                  :value="e.iron4Welding"
                  :disabled="status == 'read-only'"
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='iron_air'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">焊接旁通</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getironBypassWelding(arguments,idx)"
                  :value="e.ironBypassWelding"
                  :disabled="status == 'read-only'"
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='iron_air'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">开孔</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getironHolesOpening(arguments,idx)"
                  :value="e.ironHolesOpening"
                  :disabled="status == 'read-only'"
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='iron_air'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">封堵</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getironCleaning(arguments,idx)"
                  :value="e.ironCleaning"
                  :disabled="status == 'read-only'"
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='iron_air'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">氮气吹扫</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getironNitrogenPurging(arguments,idx)"
                  :value="e.ironNitrogenPurging"
                  :disabled="status == 'read-only'"
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='iron_air'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">管道置换</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getironPipelineReplacing(arguments,idx)"
                  :value="e.ironPipelineReplacing"
                  :disabled="status == 'read-only'"
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='iron_air'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">下堵</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getironLowerEndCap(arguments,idx)"
                  :value="e.ironLowerEndCap"
                  :disabled="status == 'read-only'"
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='iron_air'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">四通防腐</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getiron4Aczoiling(arguments,idx)"
                  :value="e.iron4Aczoiling"
                  :disabled="status == 'read-only'"
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="engineType==='iron_air'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">作业完成</h3>
              <ObsImageUpload
                  :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                  ref="obsImageUpload"
                  :limit="11"
                  :fileType="['png', 'jpg', 'jpeg']"
                  @input="getironHomeworkDone(arguments,idx)"
                  :value="e.ironHomeworkDone"
                  :disabled="status == 'read-only'"
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='下沟'">
              <h3 style="width: 95px;font-weight: 600;text-align: left;text-indent: 25px;">管上皮深度测量照片</h3>
              <ObsImageUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['png', 'jpg', 'jpeg']"
                @input="getductalEpitheliumUrl(arguments,idx)"
                :value="e.ductalEpithelium"
                :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='下沟'">
              <h3 style="width: 95px;font-weight: 600;text-align: center;text-indent: 25px;">管沟远景照片</h3>
              <ObsImageUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['png', 'jpg', 'jpeg']"
                @input="gettrenchProspectUrl(arguments,idx)"
                :value="e.trenchProspect"
                :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='下沟'">
              <h3 style="width: 95px;font-weight: 600;text-align: center;text-indent: 25px;">视频</h3>
              <ObsVideoUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['mp4']"
                @input="getVideoUrl(arguments,idx)"
                :value="e.video"
                :disabled="status == 'read-only' "
              ></ObsVideoUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='下沟'">
              <h3 style="width: 95px;font-weight: 600;text-align: center;text-indent: 25px;">管道施工记录</h3>
              <ObsImageUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['png', 'jpg', 'jpeg']"
                @input="getconstructionRecordsUrl(arguments,idx)"
                :value="e.constructionRecords"
                :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='回填'||node==='调压柜安装'||(enginClassification != null && enginClassification.includes('调压柜'))">
              <h3 style="width: 95px;font-weight: 600;text-align: center;text-indent: 25px;">石粉回填照片</h3>
              <ObsImageUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['png', 'jpg', 'jpeg']"
                @input="getstonePowderUrl(arguments,idx)"
                :value="e.stonePowder"
                :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='回填'">
              <h3 style="width: 95px;font-weight: 600;text-align: center;text-indent: 25px;">警示带铺设</h3>
              <ObsImageUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['png', 'jpg', 'jpeg']"
                @input="getwarningtTapeUrl(arguments,idx)"
                :value="e.warningtTape"
                :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='回填'">
              <h3 style="width: 95px;font-weight: 600;text-align: center;text-indent: 25px;">回填后</h3>
              <ObsImageUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['png', 'jpg', 'jpeg']"
                @input="getphotosAfterUrl(arguments,idx)"
                :value="e.photosAfter"
                :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="currentDicts.some(item=>item.label==='底腿')">
              <h3 style="width: 95px;font-weight: 600;text-align: center;text-indent: 30px;">沟上部分</h3>
              <ObsImageUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['png', 'jpg', 'jpeg']"
                @input="getonTheDitchUrl(arguments,idx)"
                :value="e.onTheDitch"
                :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="currentDicts.some(item=>item.label==='底腿')">
              <h3 style="width: 95px;font-weight: 600;text-align: center;text-indent: 25px;">开挖前</h3>
              <ObsImageUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['png', 'jpg', 'jpeg']"
                @input="getbeforeBottomUrl(arguments,idx)"
                :value="e.beforeBottom"
                :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="currentDicts.some(item=>item.label==='底腿')">
              <h3 style="width: 95px;font-weight: 600;text-align: center;text-indent: 25px;">回填</h3>
              <ObsImageUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['png', 'jpg', 'jpeg']"
                @input="getlegBackfillingUrl(arguments,idx)"
                :value="e.legBackfilling"
                :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="currentDicts.some(item=>item.label==='底腿')">
              <h3 style="width: 95px;font-weight: 600;text-align: center;text-indent: 25px;">下沟</h3>
              <ObsImageUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['png', 'jpg', 'jpeg']"
                @input="getinferiorSulcusUrl(arguments,idx)"
                :value="e.inferiorSulcus"
                :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='调压柜安装'||(enginClassification != null && enginClassification.includes('调压柜'))">
              <h3 style="width: 95px;font-weight: 600;text-align: center;text-indent: 25px;">调压柜铭牌</h3>
              <ObsImageUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['png', 'jpg', 'jpeg']"
                @input="getboxBrandUrl(arguments,idx)"
                :value="e.boxBrand"
                :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='调压柜安装'||(enginClassification != null && enginClassification.includes('调压柜'))">
              <h3 style="width: 95px;font-weight: 600;text-align: center;text-indent: 25px;">调压箱防雷接地</h3>
              <ObsImageUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['png', 'jpg', 'jpeg']"
                @input="getLightningUrl(arguments,idx)"
                :value="e.lightning"
                :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='调压柜安装'||(enginClassification != null && enginClassification.includes('调压柜'))">
              <h3 style="width: 95px;font-weight: 600;text-align: center;text-indent: 25px;">调压箱底腿连接</h3>
              <ObsImageUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['png', 'jpg', 'jpeg']"
                @input="getBottomLegUrl(arguments,idx)"
                :value="e.bottomLeg"
                :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <div style="display: flex;width: 100%;height: 100%;" v-if="node==='调压柜安装'||(enginClassification != null && enginClassification.includes('调压柜'))">
              <h3 style="width: 95px;font-weight: 600;text-align: center;text-indent: 25px;">调压箱护栏及地面硬化(远景)</h3>
              <ObsImageUpload
                :class=" status == 'read-only' ? 'obsImageUploads' : '' "
                ref="obsImageUpload"
                :limit="11"
                :fileType="['png', 'jpg', 'jpeg']"
                @input="getGroundHardeningUrl(arguments,idx)"
                :value="e.groundHardening"
                :disabled="status == 'read-only' "
              ></ObsImageUpload>
            </div>
            <!-- </el-form-item> -->
            <div style="display: flex;  justify-content: flex-end; width: 100%;height: 100%;">
            <el-button  plain type="danger" @click=" handleDelete(e)" v-hasPermi="['zdsz:engineeringCivilNode:remove']" style="width: 94px;">删除</el-button>
<!--            <hr>-->
            </div>
          </el-collapse-item>
        </el-collapse>
        </el-checkbox-group>
      </el-tab-pane>
      <el-button class="check" plain type="danger" @click="checkWorking" v-show="currentStatus == 'check'  && isChecking " style="width: 80px;" :disabled="currentCollapses.length == 0">审核</el-button>
      <el-button class="check" plain type="danger" @click="updateNodeOption" style="width: 94px;cursor: pointer;" v-if="currentStatus != 'check' && status != 'read-only'  ">修改</el-button>
    </el-tabs>
    </el-dialog>
    <!-- 审核 -->
    <el-dialog
      title="审核"
      :visible.sync="checkingVisible"
      :title="titleName"
      width="30%"
      class="checkingDialog"
      :before-close="handleChecking">
      <el-form :model="checkingInfo" ref="checking" :rules="checkingRule" class="nodeForm">
        <el-form-item
          label-width="85px"
          label="审核状态"
          prop="reviewStatus"
          >
          <el-select v-model="checkingInfo.reviewStatus" placeholder="请选择审核状态" style="width: 100%" label="审核状态" @change="validateCHanged">
              <el-option
              v-for="e in reviewStatusList"
              :key="e.label"
              :label="e.label"
              :value="e.value"
              ></el-option>
          </el-select>
        </el-form-item>

        <el-form-item
          label-width="85px"
          label="审核内容"
          prop="reviewContent"
          >
          <div class="block" style="display: inline-block; margin-right: 20px;">
              <el-input
                v-model="checkingInfo.reviewContent"
                placeholder="请输入审核内容"
                type="textarea"
                style="width: 97%"/>
          </div>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="handleChecking">取 消</el-button>
        <el-button type="primary" @click=checkingSubmit>确 定</el-button>
      </span>
    </el-dialog>
  </div>

</template>

<script>
import {
  getEnginMaterialQualityList,                    // 材质
  getEnginSpecificationsList,                     // 规格
  getDictType, deleteinfoById,                                    // 腐蚀程度
  deleteBySZGY,

} from '@/api/zdsz/enginee'
import {selectUserByUserName} from '@/api/system/user'
import ObsVideoUpload from "@/components/ObsVideoUpload/index.vue";
import {delEngineeringCivil} from "@/api/zdsz/engineeringCivil";
export default {
  name: 'ConstructionDetails',
  dicts:[
      'visit_type',
      'self_closing_valve_type',
      'brand',
    'construct_addre'
  ],
  components:{ObsVideoUpload},
  props: ['currentCollapses','nodeDetailType','enginType','status','zEngineeringNodeBo'],
  data() {
    return {
      kind:null,
      userNames:[],

      enginSort:'',
      checkList:[],
      enginNode:'',
      currentDicts: [],              // 当前类型工程节点项
      dialogVisible: false,
      activeNames: '',
      titleName: '',
      reviewStatusList:[
        {
          value:'1',
          label:'通过'
        },
        {
          value:'0',
          label:'不通过'
        }
      ],
      nodesource:'',// 审核状态option
      materialQualityList_zbf:[],                      // 自闭阀option
      materialQualityList_zjg:[],                      // 灶具管option
      materialQualityList:[],                     // 材质
      specificationsList:[],                      // 规格
      materialComponList:[],
      // The data property "enginType" is already declared as a prop.
      // enginType:null, // Use prop default value instead.
      engineType:null,
      enginClassification:null,
      nodeInfo:{
          backfillTime:'',                       // 回填时间
          constructTime:'',
          constructAccordingDrawings:'',
          segmentedCompressionQualified:'',
          zEngiineeringPhotoBoList:[],            // 照片集合
          zEngineeringMaterialBo:[],              // 用料集合
          remark:'',
        constructAddre:''
      },
      checkingInfo:{
        reviewStatus:'',               // 审核状态
        reviewContent:'',              // 审核内容
        engInfoId:'',                  // 节点Id
        createTime:'',                 // 工程创建时间
      },
      currentStatus:null,
      checkingVisible:null,
      isChecking:true,
      currentEnginId:null,
      reviewStatus:null,
      corrosionLevelListAll:[],
      infoIdList:[],
      delinfoidList:[],
      checkingRule:{
        reviewStatus: [
          {required: true, message: "审核状态不能为空", trigger: "blur"}
        ],
        reviewContent: [
          {required: true, message: "审核内容不能为空", trigger: "change"}
        ],
      },node:null
    }
  },
  created(){
      // 获取材质
    // alert(this.enginType)
      let enginStep = this.enginType == '民用工程' ? this.activeNames:null;
      getEnginMaterialQualityList({enginType:this.enginType,enginStep:enginStep}).then(res => {
          console.log('材质',res)
          this.materialQualityList = res.data
      })
      getEnginSpecificationsList().then(res => {
        console.log('规格',res.data)
        this.corrosionLevelListAll = res.data
      })

  },
  mounted() {
  },
  computed:{

  },
  watch: {
    // 此处监听variable变量，当期有变化时执行
    currentDicts(item1, item2) {
      // item1为新值，item2为旧值
      console.log('item1为新值，item2为旧值 item1=', item1)
      console.log('item1为新值，item2为旧值 item1[0].value=', item1[0].value)
      this.activeNames = item1[0].value
      this.$parent.viewNodeSource(item1[0].value)
      // alert(item1[0].value)
    },
    currentCollapses(){
      this.userNames = [];
      for(let i in this.currentCollapses){
        selectUserByUserName(this.currentCollapses[i].createBy).then(res => {
          this.userNames.push(res);
        })
      }
      try {
        console.log(1)
        this.currentCollapses[0].zEngineeringReviewBo.reviewStatus != 1 ? this.isChecking = true : false
      } catch (error) {
        this.isChecking = true
      }
      console.log('isChecking',this.isChecking)
      console.log('isChecking',this.isChecking)
      let materialQuality = []
      try {
        console.log(2)
        materialQuality = this.currentCollapses[0].zEngineeringMaterialBo[0].materialQuality
      } catch (error) {
        materialQuality = []
      }
      try {
        console.log(3)
        this.reviewStatus = this.currentCollapses[0].zEngineeringReviewBo.reviewStatus != '1' ? true : false
      } catch (error) {
        this.reviewStatus = true
      }
      if(materialQuality){
        console.log(4)
        getEnginSpecificationsList({materId:materialQuality}).then(res => {
          console.log('规格',res.data)
          this.specificationsList = res.data
        })
      }
    }
  },
  methods: {
    handleCheckedCitiesChange(e)
    {
       this.infoIdList=this.currentCollapses.filter(item=>this.checkList.indexOf(item.id)>-1)
      console.log(this.infoIdList)
   this.delinfoidList=this.currentCollapses.map(item=>item.id).filter(item=>this.checkList.indexOf(item)==-1)
    },
    validateCHanged(e){
      this.reviewStatusList[e].label == '通过' ? this.checkingRule.reviewContent[0].required = true : this.checkingRule.reviewContent[0].required = false
    },
    handleChecking(){
      this.checkingVisible = false
      this.checkingInfo = {
        reviewStatus:'',               // 审核状态
        reviewContent:'',              // 审核内容
        engInfoId:'',                  // 节点Id
        createTime:'',                 // 工程创建时间
      },
      this.$refs.checking.resetFields()
    },
    getSpecificationsList(id){
      getEnginSpecificationsList({materId:id}).then(res => {
        console.log('________a',res.data)
        return res.data
      })
    },
    // 保存节点Id
    setEngineId(e){
      this.currentEnginId = e
    },
    // 提交审核
    checkingSubmit(){
      this.$confirm('此操作将删除其他施工信息, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
      this.shenhe()
      }).catch(() => {
        // this.$message({
        //   type: 'info',
        //   message: '已取消删除'
        // });
      });
    },
    shenhe()
    {
      this.$refs.checking.validate(valid => {
        if(valid){
          try {
            this.infoIdList.nodeName = this.activeNames
            this.checkingInfo.engInfoId = this.currentEnginId
            this.checkingInfo.delInfoIdList=this.delinfoidList
            this.checkingInfo.infoIdList= this.infoIdList
            console.log('checkWorking',this.checkingInfo)
            this.$emit('checkWorking',this.checkingInfo)
            this.checkList=[]
          } catch (error) {
            this.checkingInfo.engInfoId = null
          }
          // this.dialogVisible = false
          this.checkingVisible = false
          this.checkingInfo = {
            reviewStatus:'',               // 审核状态
            reviewContent:'',              // 审核内容
            engInfoId:'',                  // 节点Id
            createTime:'',                 // 工程创建时间
          }
        } else {
          this.$message({
            message: '请完善信息',
            type: 'error'
          });
          throw 'valid Failed'
        }
      })
    },
    // 查看单节点历史
    viewSource(e) {
      console.log('节点123',e)
      console.log('节点',e)
      this.node=e.name
      // alert(this.node)
      this.nodesource=e
      let data = {enginType:this.enginType}
      if(this.enginType=='民用工程'){
        data.enginSort = this.enginSort
        data.enginStep = this.node
        data.enginNode = this.enginClassification
      }
      if(this.node == '阀管'){
        data.nameType = "自闭阀厂家";
        getEnginMaterialQualityList(data).then(res => {
          this.materialQualityList_zbf = res.data
        })
        data.nameType = "灶具管厂家";
        getEnginMaterialQualityList(data).then(res => {
          this.materialQualityList_zjg = res.data
        })
      }
      getEnginMaterialQualityList(data).then(res => {
        this.materialQualityList = res.data
      })
      this.$parent.viewNodeSource(e.name)
    },
    // 单项审核
    checkWorking() {
      if (this.checkList.length==0)
      {
        this.$message.warning("请选择需要审核通过的施工信息")
        return
      }
      if(this.currentStatus == 'check'){
        this.checkingVisible = true
      }
    },
    updateNodeOption(){
      console.log('currentCollapses')
      console.log(this.currentCollapses)
      console.log('checkList')
      console.log(this.checkList)
      if (this.checkList.length==0){
        this.$message.warning("请选择需要修改的施工信息")
        return
      }
      const intersection = this.currentCollapses.filter(value => this.checkList.includes(value.id));
      this.$emit('updateNodeOption',intersection)
    },
    deleteById(e)
    {
      console.log(e)
      deleteinfoById(e).then(res=>{
        this.viewSource(this.nodesource)
      })
    },
    deleteByIdqita(e) {
      deleteBySZGY(e).then(res => {
        this.viewSource(this.nodesource)
      })
    },
    handleDelete(row) {
      this.$modal.confirm('是否确认删除所选数据项？').then(() => {
        this.loading = true;
        if(this.kind == '民用'){
          return this.deleteById(row)

        }else{
          return this.deleteByIdqita(row);
        }

      }).then(() => {
        this.loading = false;
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      }).finally(() => {
        this.loading = false;
      });
    },
    /**
     * 查看历史
     * @param dicts 节点集合
     * @param type 字典type
     * @param currentStatus 审核状态
     * @param kind 工程类型（基建工程用）
     * @param title 标题
     * @param enginClassification 工程类型（民用工程用）
     * @param enginSort 工程分类
     * @param enginType 工程大类名称
     */
    open(dicts, type = null,currentStatus = null,kind = null,title= null,enginClassification,enginSort,enginType) {
      this.kind = kind
      if(dicts && dicts[0]){
        this.node = dicts[0].value
      }
      // alert(kind)
      // alert(enginType)
      console.log(1)
      console.log('dicts=',dicts)
      console.log('type=',type)
      console.log('currentStatus=',currentStatus)
      console.log('kind=',kind)
      console.log('node=',this.node)
      console.log('enginType=',enginType)
      console.log(2)
      // if (kind=='民用'||kind=='基建'){
      // alert(enginType)
      //   this.enginType=enginType
        this.engineType=enginType
        this.enginSort=enginSort
        this.enginClassification=enginClassification
        let data = {enginType:enginType}
      if(this.enginType =='民用工程'){
        data.enginSort = enginSort
        data.enginNode = enginClassification
        data.enginStep = Array.isArray(dicts) ? dicts[0].value: null;
      }
        getEnginMaterialQualityList(data).then(res => {
          this.materialQualityList = res.data
        })
        if(this.node == '阀管'){
          data.nameType = "自闭阀厂家";
          getEnginMaterialQualityList(data).then(res => {
            this.materialQualityList_zbf = res.data
          })
          data.nameType = "灶具管厂家";
          getEnginMaterialQualityList(data).then(res => {
            this.materialQualityList_zjg = res.data
          })
        }
      // }
      this.currentStatus = currentStatus
      this.titleName = title
      this.checkingVisible = false
      console.log(this.reviewStatus,this.currentStatus,this.isChecking)

      if (type == '1') {
        // 工业
        // alert('工业='+dicts)
        this.currentDicts = [
          {
            value: "历史数据",
            label: "历史数据"
          }
        ]
        this.$parent.viewNodeSource()
      }if (type == '2') {
        // alert('市政='+dicts)
        // 市政
        // this.currentDicts = [
        //   {
        //     value: "历史数据",
        //     label: "历史数据"
        //   }
        // ]
        this.currentDicts = dicts
        this.$parent.viewNodeSource()
      } else if (type === '危险作业工程') {
        this.$parent.viewNodeSource()
        this.currentDicts = [
          {
            value: "历史数据",
            label: "历史数据"
          }
        ]
      } else {
        console.log(4)
        console.log(dicts)
        this.dialogVisible = true
        // if (kind=='基建'){
        //   dicts=dicts.filter(item=>['水电施工','防水'].includes(item.value))
        // }
        this.currentDicts = dicts
      }
      // alert(enginType)
      if(enginType == 'pe'){
        this.currentDicts = dicts
        this.node = dicts[0].value
      }else if(enginType == 'iron_air'){
        this.currentDicts = dicts
        this.node = dicts[0].value
      }
      // alert(this.currentDicts)
      //this.currentDicts = dicts
      console.log("this.currentDicts",this.currentDicts)
      this.dialogVisible = true
      this.$forceUpdate()
    },
    // 获取材质规格
    getEnginSpecificationsList(e,idx,parentIndex){
      // 重置规格
      this.currentCollapses[parentIndex].zEngineeringMaterialBo[idx].specifications = ''
        getEnginSpecificationsList({materId:e.materialQuality}).then(res => {
            console.log('规格',res.data)
            this.specificationsList = res.data
        })
    },
    getUrl(_,idx) {
      this.currentCollapses[idx].zEngiineeringPhotoBoList = [...arguments][0][0].map(e=>e.url) || [];
    },
    getductalEpitheliumUrl(_,idx) {
      this.currentCollapses[idx].ductalEpithelium = [...arguments][0][0].map(e=>e.url) || [];
    },
    gettrenchProspectUrl(_,idx) {
      this.currentCollapses[idx].trenchProspect = [...arguments][0][0].map(e=>e.url) || [];
    },
    getstonePowderUrl(_,idx) {
      this.currentCollapses[idx].stonePowder = [...arguments][0][0].map(e=>e.url) || [];
    },
    getwarningtTapeUrl(_,idx) {
      this.currentCollapses[idx].warningtTape = [...arguments][0][0].map(e=>e.url) || [];
    },
    getbeforeBottomUrl(_,idx) {
      this.currentCollapses[idx].beforeBottom = [...arguments][0][0].map(e=>e.url) || [];
    },
    getlegBackfillingUrl(_,idx) {
      this.currentCollapses[idx].legBackfilling = [...arguments][0][0].map(e=>e.url) || [];
    },
    getboxBrandUrl(_,idx) {
      this.currentCollapses[idx].boxBrand = [...arguments][0][0].map(e=>e.url) || [];
    },
    getLightningUrl(_,idx) {
      this.currentCollapses[idx].lightning = [...arguments][0][0].map(e=>e.url) || [];
    },
    getBottomLegUrl(_,idx) {
      this.currentCollapses[idx].bottomLeg = [...arguments][0][0].map(e=>e.url) || [];
    },
    getGroundHardeningUrl(_,idx) {
      this.currentCollapses[idx].groundHardening = [...arguments][0][0].map(e=>e.url) || [];
    },
    getinferiorSulcusUrl(_,idx) {
      this.currentCollapses[idx].inferiorSulcus = [...arguments][0][0].map(e=>e.url) || [];
    },
    getphotosAfterUrl(_,idx) {
      this.currentCollapses[idx].photosAfter = [...arguments][0][0].map(e=>e.url) || [];
    },
  getVideoUrl(_,idx) {
    this.currentCollapses[idx].video = [...arguments][0][0].map(e=>e.url) || [];
    console.log(this.currentCollapses[idx].video)
  },
    getconstructionRecordsUrl(_,idx)
    {
      this.currentCollapses[idx].constructionRecords = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].constructionRecords)
    },
    getonTheDitchUrl(_,idx)
    {
      this.currentCollapses[idx].onTheDitch = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].onTheDitch)
    },
    getwelding(_,idx)
    {
      this.currentCollapses[idx].welding = [...arguments][0][0].map(e=>e.url) || [];
      console.log("焊接照片===",this.currentCollapses[idx].welding)
    },
    getaczoiling(_,idx)
    {
      this.currentCollapses[idx].aczoiling = [...arguments][0][0].map(e=>e.url) || [];
      console.log("防腐照片===",this.currentCollapses[idx].aczoiling)
    },
    getpiping(_,idx)
    {
      this.currentCollapses[idx].piping = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].piping)
    },
    getwarning(_,idx)
    {
      this.currentCollapses[idx].warning = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].warning)
    },
    getbackfilling(_,idx)
    {
      this.currentCollapses[idx].backfilling = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].backfilling)
    },
    getpeAirrecovering(_,idx)
    {
      this.currentCollapses[idx].peAirrecovering = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].peAirrecovering)
    },
    getpeAirtightTest(_,idx)
    {
      this.currentCollapses[idx].peAirtightTest = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].peAirtightTest)
    },
    getpeCleaning(_,idx)
    {
      this.currentCollapses[idx].peCleaning = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].peCleaning)
    },
    getpeCollisionOperating(_,idx)
    {
      this.currentCollapses[idx].peCollisionOperating = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].peCollisionOperating)
    },
    getpeHolesOpening(_,idx)
    {
      this.currentCollapses[idx].peHolesOpening = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].peHolesOpening)
    },
    getpeHomeworkDone(_,idx)
    {
      this.currentCollapses[idx].peHomeworkDone = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].peHomeworkDone)
    },
    getpePlugging(_,idx)
    {
      this.currentCollapses[idx].pePlugging = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].pePlugging)
    },
    getpeSaddleWelding(_,idx)
    {
      this.currentCollapses[idx].peSaddleWelding = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].peSaddleWelding)
    },
    getiron4Aczoiling(_,idx)
    {
      this.currentCollapses[idx].iron4Aczoiling = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].iron4Aczoiling)
    },
    getiron4Welding(_,idx)
    {
      this.currentCollapses[idx].iron4Welding = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].iron4Welding)
    },
    getironBypassWelding(_,idx)
    {
      this.currentCollapses[idx].ironBypassWelding = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].ironBypassWelding)
    },
    getironCleaning(_,idx)
    {
      this.currentCollapses[idx].ironCleaning = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].ironCleaning)
    },
    getironHolesOpening(_,idx)
    {
      this.currentCollapses[idx].ironHolesOpening = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].ironHolesOpening)
    },
    getironHomeworkDone(_,idx)
    {
      this.currentCollapses[idx].ironHomeworkDone = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].ironHomeworkDone)
    },
    getironLowerEndCap(_,idx)
    {
      this.currentCollapses[idx].ironLowerEndCap = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].ironLowerEndCap)
    },
    getironNitrogenPurging(_,idx)
    {
      this.currentCollapses[idx].ironNitrogenPurging = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].ironNitrogenPurging)
    },
    getironPipelineReplacing(_,idx)
    {
      this.currentCollapses[idx].ironPipelineReplacing = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].ironPipelineReplacing)
    },
    getironPipelineThickness(_,idx)
    {
      this.currentCollapses[idx].ironPipelineThickness = [...arguments][0][0].map(e=>e.url) || [];
      console.log(this.currentCollapses[idx].ironPipelineThickness)
    },
  }
}
</script>

<style lang="scss" scoped>
::v-deep .nodeForm{
  .el-form-item__content{
    display: flex;
  }
}

::v-deep .materialForm{
  display: flex !important;
  flex-wrap: wrap;
  .el-form-item{
    width: 320px;
  }
}
::v-deep .obsImageUpload{
  .el-upload--picture-card{
    display: block !important;
  }
}
::v-deep .obsImageUpload >div{
  display: flex;
}
::v-deep .el-dialog {
  height: 85%;

  .el-dialog__body {
    overflow: hidden;
    height: 91%;
  }
}

::v-deep .el-upload-notShow{
  .el-upload--picture-card {
    display: none;
  }
}

::v-deep .labelWidth{
  .el-form-item__label{
    width: 100px;
  }
}

::v-deep .obsImageUploads{
  .el-upload--picture-card{
    display: none;
  }
}
.ConstructionDetailsDialog {
  position: absolute;

  .projectTabs {
    height: 100%;
    overflow: hidden;
    overflow-y: scroll;
    margin-top: 4%;

    ::v-deep .el-tabs__content {
      margin-top: 1%;
    }

    ::v-deep .el-tabs__nav {
      border: none;
      overflow: hidden;
      overflow-x: scroll;
    }

    ::v-deep .el-tabs__item {
      // width: 47%;
      border: 1px solid #a3d3ff;
      border-radius: 5px;
    }

    ::v-deep .el-tabs__item.is-active {
      background-color: #e8f4ff;
      color: #1890ff;
    }

    ::v-deep .el-tabs__header {
      position: fixed;
      width: 53%;
      border: none;
      top: 13%;
    }

    ::v-deep .el-collapse-item__wrap {
      padding: 0 4%;
    }

    .check {
      position: fixed;
      right: 22.1%;
      top: 13.1%;
      height: 4.6%;
      //background-color: #CC9900;
      //color: #fff;
    }
  }

  .projectTabs::-webkit-scrollbar {
    display: none;
  }

  ::v-deep .rmOldPie {

    .el-collapse-item {
      border: none;
    }
  }
}
.personInfo >span:not(:nth-child(1)){
  margin-left: 50px;
}
::v-deep .checkingDialog{
 height: 50%;
 margin-top: 6%;
 .el-dialog__body{
  height: 72%;
 }
 .el-textarea__inner{
  width: 246%;
  height: 140px;
 }
}
</style>
